Visual bug in gtk_widget_set_sensitive() / GtkOptionMenu



I upgraded to gtk+-1.1.5 tonight and have noticed a bug in
gtk_widget_set_sensitive() or GtkOptionMenu, I am not sure which.

I have a widget subtree that looks like this...

	GtkHBox
	  GtkLabel
	  GtkOptionMenu

Each item in the option menu looks like this...

	GtkMenuItem
	  GtkHBox
	    GtkPixmap
	    GtkLabel

In my application, there are times that the option menu should not be
sensitive, so I make the top level hbox insensitive to grey out the
label and disable the option menu.

Once the option menu is sensitive, there are times when some of the
items should not be selected, so I set their sensitivity
appropriately.

The widgets always respond to the user as they should.  The visual
appearance is another story.  When the top level hbox is set
sensitive, all of the menu items are displayed correctly, but once a
menu item has been set insensitive individually, it stays that way
visually.

Now it seems that the way that GtkOptionMenu works is subverting the
operation of gtk_widget_set_sensitive().  The last time I looked at
the source, the option menu displayed the current selection by
re-parenting the contents of the active menu item.  This means that
setting the sensitivity of the currently selected menu item will not
work as expected - its' contents are no longer there!

I worked around it in my application by doing this all of the time...

    gtk_widget_set_sensitive(GTK_BIN(elem_option)->child, TRUE);

I would suggest that this is sub-optimal.

- Dave

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS dpu s-:+ a C++$ ULS++$ P+++$>++++ L++>+++$ E+>++ W N++ !o K w++$ O !M-
!V(-) PS+ PE- Y+ PGP !t-- 5++ X R tv b+ DI+++ D G e++ h--- r+++ y++++
------END GEEK CODE BLOCK------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]