How to disable/inactive some of the GtkMenu Items

User7723337 picture User7723337 · Nov 10, 2009 · Viewed 8.6k times · Source

I am trying to disable/inactive some of menu items under GTK+. I have created Menu In GTK+Glade under C, and on some external event I need to disable some of the menu options.

How can I do this?

Answer

axel_c picture axel_c · Nov 10, 2009

You can use gtk_widget_set_sensitive(menuitem, true/false) to disable or enable the menu item widget.

Alternatively, if you used GtkUiManager and GtkAction to build the menu, use gtk_action_set_sensitive() instead.