Gtk2HsContentsIndex
Graphics.UI.Gtk.MenuComboToolbar.OptionMenu
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Contents
Detail
Class Hierarchy
Types
Constructors
Methods
Attributes
Signals
Description

A widget used to choose from a list of valid choices

  • Warning: this module is deprecated and should not be used in newly-written code.
Synopsis
data OptionMenu
class ButtonClass o => OptionMenuClass o
castToOptionMenu :: GObjectClass obj => obj -> OptionMenu
toOptionMenu :: OptionMenuClass o => o -> OptionMenu
optionMenuNew :: IO OptionMenu
optionMenuGetMenu :: OptionMenuClass self => self -> IO Menu
optionMenuSetMenu :: (OptionMenuClass self, MenuClass menu) => self -> menu -> IO ()
optionMenuRemoveMenu :: OptionMenuClass self => self -> IO ()
optionMenuSetHistory :: OptionMenuClass self => self -> Int -> IO ()
optionMenuGetHistory :: OptionMenuClass self => self -> IO Int
optionMenuMenu :: (OptionMenuClass self, MenuClass menu) => ReadWriteAttr self Menu menu
onOMChanged :: OptionMenuClass self => self -> IO () -> IO (ConnectId self)
afterOMChanged :: OptionMenuClass self => self -> IO () -> IO (ConnectId self)
Detail

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

Using a OptionMenu is simple; build a Menu, by calling menuNew, then appending menu items to it with menuShellAppend. Set that menu on the option menu with optionMenuSetMenu. Set the selected menu item with optionMenuSetHistory; connect to the "changed" signal on the option menu; in the "changed" signal, check the new selected menu item with optionMenuGetHistory.

As of Gtk+ 2.4, OptionMenu has been deprecated in favor of ComboBox.

Class Hierarchy
 |  GObject
 |   +----Object
 |         +----Widget
 |               +----Container
 |                     +----Bin
 |                           +----Button
 |                                 +----OptionMenu
 
Types
data OptionMenu
show/hide Instances
class ButtonClass o => OptionMenuClass o
show/hide Instances
castToOptionMenu :: GObjectClass obj => obj -> OptionMenu
toOptionMenu :: OptionMenuClass o => o -> OptionMenu
Constructors
optionMenuNew :: IO OptionMenu
Create a new option menu.
Methods
optionMenuGetMenu :: OptionMenuClass self => self -> IO Menu
Returns the Menu associated with the OptionMenu.
optionMenuSetMenu :: (OptionMenuClass self, MenuClass menu) => self -> menu -> IO ()
Provides the 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.
optionMenuRemoveMenu :: OptionMenuClass self => self -> IO ()
Removes the menu from the option menu.
optionMenuSetHistory
:: OptionMenuClass self
=> self
-> Intindex - the index of the menu item to select. Index values are from 0 to n-1.
-> IO ()
Selects the menu item specified by index making it the newly selected value for the option menu.
optionMenuGetHistory
:: OptionMenuClass self
=> self
-> IO Intreturns index of the selected menu item, or -1 if there are no menu items
Retrieves the index of the currently selected menu item. The menu items are numbered from top to bottom, starting with 0.
Attributes
optionMenuMenu :: (OptionMenuClass self, MenuClass menu) => ReadWriteAttr self Menu menu
The menu of options.
Signals
onOMChanged :: OptionMenuClass self => self -> IO () -> IO (ConnectId self)
This signal is called if the selected option has changed.
afterOMChanged :: OptionMenuClass self => self -> IO () -> IO (ConnectId self)
Produced by Haddock version 0.8