tags:

views:

214

answers:

1

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...

hot to do this?

+2  A: 

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.

axel_c
One more question.. how can i get to know that which menu item is selected... i have created menu in Glade... can i associate some Constant ID or Enum Constant to each menu items... so in call back i can bifurcate functionality depending on Constant.
PP
You can either attach a different callback for each item's "activate" signal, or connect all the items to a single callback and check the first argument to see what item was selected. See http://library.gnome.org/devel/gtk/unstable/GtkMenuItem.html#GtkMenuItem-activate for details.
axel_c