| version 1.1, 2004/07/14 16:01:40 | version 1.8, 2011/01/15 16:14:52 | 
| Line 12 | Line 12 | 
 | * 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | 
 | *    notice, this list of conditions and the following disclaimer in the | *    notice, this list of conditions and the following disclaimer in the | 
 | *    documentation and/or other materials provided with the distribution. | *    documentation and/or other materials provided with the distribution. | 
 | * 3. The name of the author may not be used to endorse or promote products |  | 
 | *    derived from this software without specific prior written permission. |  | 
 | * | * | 
 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 
 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 
| Line 33 | Line 31 | 
 | #include "np2ver.h" | #include "np2ver.h" | 
 |  |  | 
 | #include "gtk2/xnp2.h" | #include "gtk2/xnp2.h" | 
 |  | #include "gtk2/gtk_menu.h" | 
 |  |  | 
 | #include "resources/np2.xpm" | #include "resources/np2.xpm" | 
 |  |  | 
| Line 41  static void | Line 40  static void | 
 | about_destroy(GtkWidget *w, GtkWidget **wp) | about_destroy(GtkWidget *w, GtkWidget **wp) | 
 | { | { | 
 |  |  | 
 | UNUSED(wp); |  | 
 |  |  | 
 | install_idle_process(); | install_idle_process(); | 
 | gtk_widget_destroy(w); | gtk_widget_destroy(w); | 
 | } | } | 
| Line 57  create_about_dialog(void) | Line 54  create_about_dialog(void) | 
 | GtkWidget *ok_button; | GtkWidget *ok_button; | 
 | GtkWidget *neko_image; | GtkWidget *neko_image; | 
 | GdkColormap *colormap; | GdkColormap *colormap; | 
| GdkPixmap *neko_pixmap; | GdkPixbuf *neko_pixbuf; | 
| GdkBitmap *mask; |  | 
 |  |  | 
 | uninstall_idle_process(); | uninstall_idle_process(); | 
 |  |  | 
| Line 69  create_about_dialog(void) | Line 65  create_about_dialog(void) | 
 | gtk_window_set_resizable(GTK_WINDOW(about_dialog), FALSE); | gtk_window_set_resizable(GTK_WINDOW(about_dialog), FALSE); | 
 | gtk_container_set_border_width(GTK_CONTAINER(about_dialog), 10); | gtk_container_set_border_width(GTK_CONTAINER(about_dialog), 10); | 
 | g_signal_connect(GTK_OBJECT(about_dialog), "destroy", | g_signal_connect(GTK_OBJECT(about_dialog), "destroy", | 
| GTK_SIGNAL_FUNC(about_destroy), NULL); | G_CALLBACK(about_destroy), NULL); | 
 |  |  | 
 | main_widget = gtk_hbox_new(FALSE, 3); | main_widget = gtk_hbox_new(FALSE, 3); | 
 | gtk_widget_show(main_widget); | gtk_widget_show(main_widget); | 
 | gtk_container_add(GTK_CONTAINER(about_dialog), main_widget); | gtk_container_add(GTK_CONTAINER(about_dialog), main_widget); | 
 |  |  | 
 | colormap = gtk_widget_get_colormap(about_dialog); | colormap = gtk_widget_get_colormap(about_dialog); | 
| neko_pixmap = gdk_pixmap_colormap_create_from_xpm_d(NULL, colormap, | neko_pixbuf = gdk_pixbuf_new_from_xpm_data(np2_icon); | 
| &mask, NULL, (gchar **)np2_icon); | neko_image = gtk_image_new_from_pixbuf(neko_pixbuf); | 
| if (neko_pixmap == NULL) | g_object_unref(neko_pixbuf); | 
| g_error("Couldn't create replacement pixmap."); |  | 
| neko_image = gtk_image_new_from_pixmap(neko_pixmap, mask); |  | 
| gdk_pixmap_unref(neko_pixmap); |  | 
| gdk_bitmap_unref(mask); |  | 
 | gtk_widget_show(neko_image); | gtk_widget_show(neko_image); | 
 | gtk_box_pack_start(GTK_BOX(main_widget), neko_image, FALSE, FALSE, 10); | gtk_box_pack_start(GTK_BOX(main_widget), neko_image, FALSE, FALSE, 10); | 
 |  |  | 
| Line 99  create_about_dialog(void) | Line 91  create_about_dialog(void) | 
 | gtk_widget_show(ok_button); | gtk_widget_show(ok_button); | 
 | gtk_box_pack_end(GTK_BOX(main_widget), ok_button, FALSE, TRUE, 0); | gtk_box_pack_end(GTK_BOX(main_widget), ok_button, FALSE, TRUE, 0); | 
 | g_signal_connect_swapped(GTK_OBJECT(ok_button), "clicked", | g_signal_connect_swapped(GTK_OBJECT(ok_button), "clicked", | 
| GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(about_dialog)); | G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(about_dialog)); | 
| GTK_WIDGET_SET_FLAGS(ok_button, GTK_CAN_DEFAULT); | gtk_widget_set_can_default(ok_button, TRUE); | 
| GTK_WIDGET_SET_FLAGS(ok_button, GTK_HAS_DEFAULT); | gtk_widget_has_default(ok_button); | 
 | gtk_widget_grab_default(ok_button); | gtk_widget_grab_default(ok_button); | 
 |  |  | 
 | gtk_widget_show_all(about_dialog); | gtk_widget_show_all(about_dialog); |