Realize window before creating xpm so it gets the right colormap/visual,

Fri Feb 13 00:33:26 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/testgtk.c (shape_create_icon): Realize window before
	  creating xpm so it gets the right colormap/visual,
	  instead of the default one.
This commit is contained in:
Owen Taylor 1998-02-13 05:33:17 +00:00 committed by Owen Taylor
parent 041983a776
commit c3fc26bb9d
9 changed files with 56 additions and 10 deletions

View File

@ -1,3 +1,9 @@
Fri Feb 13 00:33:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (shape_create_icon): Realize window before
creating xpm so it gets the right colormap/visual,
instead of the default one.
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu> Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch] * gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]

View File

@ -1,3 +1,9 @@
Fri Feb 13 00:33:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (shape_create_icon): Realize window before
creating xpm so it gets the right colormap/visual,
instead of the default one.
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu> Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch] * gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]

View File

@ -1,3 +1,9 @@
Fri Feb 13 00:33:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (shape_create_icon): Realize window before
creating xpm so it gets the right colormap/visual,
instead of the default one.
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu> Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch] * gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]

View File

@ -1,3 +1,9 @@
Fri Feb 13 00:33:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (shape_create_icon): Realize window before
creating xpm so it gets the right colormap/visual,
instead of the default one.
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu> Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch] * gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]

View File

@ -1,3 +1,9 @@
Fri Feb 13 00:33:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (shape_create_icon): Realize window before
creating xpm so it gets the right colormap/visual,
instead of the default one.
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu> Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch] * gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]

View File

@ -1,3 +1,9 @@
Fri Feb 13 00:33:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (shape_create_icon): Realize window before
creating xpm so it gets the right colormap/visual,
instead of the default one.
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu> Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch] * gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]

View File

@ -1,3 +1,9 @@
Fri Feb 13 00:33:26 1998 Owen Taylor <owt1@cornell.edu>
* gtk/testgtk.c (shape_create_icon): Realize window before
creating xpm so it gets the right colormap/visual,
instead of the default one.
Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu> Thu Feb 12 23:59:49 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch] * gtk/gtksignal.[ch] gtk/gtkmain.[ch] gtk/gtkcontainer.[ch]

View File

@ -2015,7 +2015,7 @@ file_selection_ok (GtkWidget *w,
GtkFileSelection *fs) GtkFileSelection *fs)
{ {
g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
gtk_widget_destroy (fs); gtk_widget_destroy (GTK_WIDGET (fs));
} }
void void
@ -2873,6 +2873,12 @@ shape_create_icon (char *xpm_file,
gtk_container_add (GTK_CONTAINER (window), fixed); gtk_container_add (GTK_CONTAINER (window), fixed);
gtk_widget_show (fixed); gtk_widget_show (fixed);
gtk_widget_set_events (window,
gtk_widget_get_events (window) |
GDK_BUTTON_MOTION_MASK |
GDK_BUTTON_PRESS_MASK);
gtk_widget_realize (window);
gdk_pixmap = gdk_pixmap_create_from_xpm (window->window, &gdk_pixmap_mask, gdk_pixmap = gdk_pixmap_create_from_xpm (window->window, &gdk_pixmap_mask,
&style->bg[GTK_STATE_NORMAL], &style->bg[GTK_STATE_NORMAL],
xpm_file); xpm_file);
@ -2883,10 +2889,6 @@ shape_create_icon (char *xpm_file,
gtk_widget_shape_combine_mask (window, gdk_pixmap_mask, px,py); gtk_widget_shape_combine_mask (window, gdk_pixmap_mask, px,py);
gtk_widget_set_events (window,
gtk_widget_get_events (window) |
GDK_BUTTON_MOTION_MASK |
GDK_BUTTON_PRESS_MASK);
gtk_signal_connect (GTK_OBJECT (window), "button_press_event", gtk_signal_connect (GTK_OBJECT (window), "button_press_event",
GTK_SIGNAL_FUNC (shape_pressed),NULL); GTK_SIGNAL_FUNC (shape_pressed),NULL);

View File

@ -2015,7 +2015,7 @@ file_selection_ok (GtkWidget *w,
GtkFileSelection *fs) GtkFileSelection *fs)
{ {
g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
gtk_widget_destroy (fs); gtk_widget_destroy (GTK_WIDGET (fs));
} }
void void
@ -2873,6 +2873,12 @@ shape_create_icon (char *xpm_file,
gtk_container_add (GTK_CONTAINER (window), fixed); gtk_container_add (GTK_CONTAINER (window), fixed);
gtk_widget_show (fixed); gtk_widget_show (fixed);
gtk_widget_set_events (window,
gtk_widget_get_events (window) |
GDK_BUTTON_MOTION_MASK |
GDK_BUTTON_PRESS_MASK);
gtk_widget_realize (window);
gdk_pixmap = gdk_pixmap_create_from_xpm (window->window, &gdk_pixmap_mask, gdk_pixmap = gdk_pixmap_create_from_xpm (window->window, &gdk_pixmap_mask,
&style->bg[GTK_STATE_NORMAL], &style->bg[GTK_STATE_NORMAL],
xpm_file); xpm_file);
@ -2883,10 +2889,6 @@ shape_create_icon (char *xpm_file,
gtk_widget_shape_combine_mask (window, gdk_pixmap_mask, px,py); gtk_widget_shape_combine_mask (window, gdk_pixmap_mask, px,py);
gtk_widget_set_events (window,
gtk_widget_get_events (window) |
GDK_BUTTON_MOTION_MASK |
GDK_BUTTON_PRESS_MASK);
gtk_signal_connect (GTK_OBJECT (window), "button_press_event", gtk_signal_connect (GTK_OBJECT (window), "button_press_event",
GTK_SIGNAL_FUNC (shape_pressed),NULL); GTK_SIGNAL_FUNC (shape_pressed),NULL);