|
|
| version 1.2, 2004/07/15 14:24:33 | version 1.10, 2012/01/23 04:46:47 |
|---|---|
| Line 1 | Line 1 |
| /* $Id$ */ | |
| /* | /* |
| * Copyright (c) 2002-2003 NONAKA Kimihiro | * Copyright (c) 2002-2003 NONAKA Kimihiro |
| * All rights reserved. | * All rights reserved. |
| Line 12 | Line 10 |
| * 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 42 static void | Line 38 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 51 create_about_dialog(void) |
| GtkWidget *ver_label; | GtkWidget *ver_label; |
| GtkWidget *ok_button; | GtkWidget *ok_button; |
| GtkWidget *neko_image; | GtkWidget *neko_image; |
| GdkColormap *colormap; | GdkPixbuf *neko_pixbuf; |
| GdkPixmap *neko_pixmap; | |
| GdkBitmap *mask; | |
| uninstall_idle_process(); | uninstall_idle_process(); |
| Line 70 create_about_dialog(void) | Line 62 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); | neko_pixbuf = gdk_pixbuf_new_from_xpm_data(np2_icon); |
| neko_pixmap = gdk_pixmap_colormap_create_from_xpm_d(NULL, colormap, | neko_image = gtk_image_new_from_pixbuf(neko_pixbuf); |
| &mask, NULL, (gchar **)np2_icon); | g_object_unref(neko_pixbuf); |
| if (neko_pixmap == NULL) | |
| 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 100 create_about_dialog(void) | Line 87 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); |