"indicator-size"ReadThe size of the dropdown indicator"indicator-spacing"ReadThe spacing around the indicator.
gtk.OptionMenu Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Container Signal Prototypesgtk.Button Signal Prototypes"changed"callbackoptionmenuuser_param1...Descriptiongtk.OptionMenu
is deprecated in PyGTK 2.4; use the gtk.ComboBox
instead.A gtk.OptionMenu
is a widget allows the user to choose from a list of valid choices from an
associated menu. The gtk.OptionMenu
displays the last selected choice. When activated (clicked) 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 using gtk.Menu()then append menu items to it using gtk.MenuShell.append()associate the menu with the option menu using set_menu()set the selected menu item with set_history()connect to the "changed" signal on the option menu; in the
"changed" signalcheck the new selected menu item with get_history().Constructorgtk.OptionMenuReturns :a new optionmenu widgetCreates a new gtk.OptionMenu
widget.Methodsgtk.OptionMenu.get_menuget_menuReturns :a menu widget or None if no
menu is associatedThe get_menu() method returns the menu
that is associated with the optionmenu or None if no menu
is associated.gtk.OptionMenu.set_menuset_menumenumenu :a menu to be associated with the
optionmenuThe set_menu() method associates the
gtk.Menu widget
specified by menu with the optionmenu thus providing
the way for a user to select a new choice. A simple menu, avoiding the use
of tearoff menu items, submenus, and accelerators, should be used.gtk.OptionMenu.remove_menuremove_menuThe remove_menu() method removes the
currently associated menu from the optionmenu.gtk.OptionMenu.get_historyget_historyReturns :the index of the selected menu item, or -1 if
there are no menu itemsThe get_history() method returns the
index of the currently selected menu item or -1 if there are no menu items.
The menu items are numbered from top to bottom, starting with 0.gtk.OptionMenu.set_historyset_historyindexindex :the index of the menu item to display as the
selected optionmenu choiceThe set_history() method selects the
menu item specified by index as the displayed
optionmenu choice.SignalsThe "changed" gtk.OptionMenu Signalcallbackoptionmenuuser_param1...optionmenu :the optionmenu that received the
signaluser_param1 :the first user parameter (if any) specified
with the connect()
method... :additional user parameters (if
any)The "changed" signal is emitted when a new optionmenu choice is
made.