After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 56452 - Drawing Bug Related to EventBoxes
Drawing Bug Related to EventBoxes
Status: RESOLVED NOTABUG
Product: gtk+
Classification: Platform
Component: Widget: Other
1.2.x
Other other
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2001-06-20 14:37 UTC by jcape
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jcape 2001-06-20 14:32:05 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.

Comment 1 Owen Taylor 2001-06-23 16:05:53 UTC
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.)