diff options
author | Owen Taylor <otaylor@gtk.org> | 1998-06-13 01:36:28 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1998-06-13 01:36:28 +0000 |
commit | 92270f862031189db6efef152c13184a754f3a68 (patch) | |
tree | f65ab078c33a78e6079cbd289ca0f1d1e0dd1602 /gtk/gtkoptionmenu.c | |
parent | 1dc1b050b2a46813102cb58e8ca5b30c07943ba4 (diff) | |
download | gtk+-92270f862031189db6efef152c13184a754f3a68.tar.gz |
Removed code for drawing the child in two places at once. Unfortunately,
Fri Jun 12 21:20:42 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkoptionmenu.c (gtk_option_menu_expose): Removed
code for drawing the child in two places at once. Unfortunately,
not only does it not work anymore (because reparenting has
been fixed), but it also triggers reparent/expose loops
in some cases.
* gtk/gtkoptionmenu.c (gtk_option_menu_remove_contents): Removed
an unecessary unrealize.
Diffstat (limited to 'gtk/gtkoptionmenu.c')
-rw-r--r-- | gtk/gtkoptionmenu.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c index 4b3f798cb0..228f496e6f 100644 --- a/gtk/gtkoptionmenu.c +++ b/gtk/gtkoptionmenu.c @@ -379,6 +379,18 @@ gtk_option_menu_expose (GtkWidget *widget, { gtk_option_menu_paint (widget, &event->area); + + /* The following code tries to draw the child in two places at + * once. It fails miserably for several reasons + * + * - If the child is not no-window, removing generates + * more expose events. Bad, bad, bad. + * + * - Even if the child is no-window, removing it now (properly) + * clears the space where it was, so it does no good + */ + +#if 0 remove_child = FALSE; child = GTK_BUTTON (widget)->child; @@ -401,6 +413,14 @@ gtk_option_menu_expose (GtkWidget *widget, if (remove_child) gtk_option_menu_remove_contents (GTK_OPTION_MENU (widget)); +#else + child = GTK_BUTTON (widget)->child; + child_event = *event; + if (child && GTK_WIDGET_NO_WINDOW (child) && + gtk_widget_intersect (child, &event->area, &child_event.area)) + gtk_widget_event (child, (GdkEvent*) &child_event); + +#endif /* 0 */ } return FALSE; @@ -491,7 +511,6 @@ gtk_option_menu_remove_contents (GtkOptionMenu *option_menu) if (GTK_WIDGET (option_menu->menu_item)->state != GTK_BUTTON (option_menu)->child->state) gtk_widget_set_state (GTK_BUTTON (option_menu)->child, GTK_WIDGET (option_menu->menu_item)->state); - gtk_widget_unrealize (GTK_BUTTON (option_menu)->child); gtk_widget_reparent (GTK_BUTTON (option_menu)->child, option_menu->menu_item); gtk_widget_unref (option_menu->menu_item); option_menu->menu_item = NULL; |