Crea  Modifica  FrontPage  Indici  Cerca  Ultime modifiche  History  RSS  Login


class Gtk::OptionMenu

A Gtk::OptionMenu is a widget that allows the user to choose from a list of valid choices. The Gtk::OptionMenu displays the selected choice. When activated the Gtk::OptionMenu displays a popup Gtk::Menu which allows the user to make a new choice.

Using a Gtk::OptionMenu is simple; build a Gtk::Menu, by calling, then appending menu items to it with Gtk::MenuShell#append. Set that menu on the option menu with Gtk::OptionMenu#menu=. Set the selected menu item with Gtk::OptionMenu#history=; connect to the "changed" signal on the option menu; in the "changed" signal, check the new selected menu item with Gtk::OptionMenu#history.

Instance Methods

Returns the Gtk::Menu associated with the Gtk::OptionMenu.
Provides the Gtk::Menu that is popped up to allow the user to choose a new value. You should provide a simple menu avoiding the use of tearoff menu items, submenus, and accelerators.
Same as Gtk::OptionMenu#menu=.
Removes the menu from the option menu.
  • Returns: self
Retrieves the index of the currently selected menu item. The menu items are numbered from top to bottom, starting with 0.
  • Returns: index of the selected menu item, or -1 if there are no menu items
Selects the menu item specified by index making it the newly selected value for the option menu.
  • index: the index of the menu item to select. Index values are from 0 to n-1.
  • Returns: index
Same as Gtk::OptionMenu#history=.
  • index: the index of the menu item to select. Index values are from 0 to n-1.
  • Returns: self
Ultima modifica:2008/04/06 03:58:06
Parola chiave:
Referenze:[Gtk::Label] [Gtk::RadioButton] [Gtk::OptionMenu] [Gtk::FileSelection] [Gtk::ComboBox] [Gtk::ItemFactory] [Gtk::Menu]