GNOME Bugzilla – Bug 56452
Drawing Bug Related to EventBoxes
Last modified: 2004-12-22 21:47:04 UTC
Package: gtk+ Severity: normal Version: 1.2.10 Synopsis: Drawing Bug Related to EventBoxes Bugzilla-Product: gtk+ Bugzilla-Component: gtk Description: There is a bug in GtkLabel where it does not properly draw if it is inside a GtkEventBox with the "event" bound. Here's some code which exposes this bug: expander_eventbox = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (chat->expander_alignment), expander_eventbox); gtk_widget_show (expander_eventbox); expander_hbox = gtk_hbox_new (FALSE, 4); gtk_signal_connect (GTK_OBJECT (expander_eventbox), "event", GTK_SIGNAL_FUNC (chat_toggle_multiline_cb), chat); gtk_container_add (GTK_CONTAINER (expander_eventbox), expander_hbox); gtk_widget_show (expander_hbox); chat->nick_label = gtk_label_new (_("(Nickname)")); gtk_box_pack_start (GTK_BOX (expander_hbox), chat->nick_label, FALSE, FALSE, 0); gtk_widget_show (chat->nick_label); In the above code, neither the GtkLabel nor the GtkArrow will be drawn. But, if I replace: gtk_signal_connect (GTK_OBJECT (expander_eventbox), "event", GTK_SIGNAL_FUNC (chat_toggle_multiline_cb), chat); with: gtk_signal_connect_object (GTK_OBJECT (expander_eventbox), "event", gtk_widget_queue_draw, GTK_OBJECT (expander_hbox)); gtk_signal_connect (GTK_OBJECT (expander_eventbox), "event", GTK_SIGNAL_FUNC (chat_toggle_multiline_cb), chat); It works ok... ------- Bug moved to this database by unknown@bugzilla.gnome.org 2001-06-20 10:32 ------- The original reporter (jcape@jimbob.myip.org) of this bug does not have an account here. Reassigning to the exporter, unknown@bugzilla.gnome.org. Reassigning to the default owner of the component, gtk-bugs@gtk.org.
Most likely, your event_cb is catching expose events and returning TRUE, so the default expose event handler for the event box is not running, and redrawing is not working properly. (best to provide (small) complete compilable examples, rather than code fragments.)