开发者

GTK+ menu item not sensitizing first call to gtk_widget_set_sensitive()

开发者 https://www.devze.com 2023-02-15 11:37 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消