My application has an "Actions" menu with a "Delete" submenu which does not get sensitized the first time I select an item from a list, even though I am explicitly calling
gtk_widget_set_sensitive(GTK_WIDGET(DeleteMenuItem), TRUE);
in the button release event of the treeview for the list.
However... If I select an item from the list, select the "Actions" menu, then select another item from the list, then select "Actions" menu item, the "Delete" menu item is now sensitized.
Is this a bug in GTK? (version 2.4.6, I know, but开发者_如何学JAVA unfortunately, I am not able to go to a newer version of the GTK)
I appreciate the help, bernie
It looks like the "button release event" is not triggered, maybe because there is not "release event" the first time. You might want to use a different event (I could not get clearly the use case, so I am not suggesting any event in particular).
In short: gtk_widget_set_sensitive() is not the problem, the problem is when you call it.
精彩评论