org.gnu.gtk

Class OptionMenu

public class OptionMenu extends Button

Deprecated: Replaced by {@link ComboBox} in gtk 2.3

deprecated menu widget replaced by {@link ComboBox} in gtk 2.3. An OptionMenu is a widget that allows the user to choose from a list of valid choices. When activated the OptionMenu displays a popup Menu which allows the user to make a new choice.
Constructor Summary
OptionMenu()
Create a new OptionMenu.
OptionMenu(Handle handle)
Construct an OptionMenu using a handle to a native resource.
Method Summary
voidaddListener(OptionMenuListener listener)
Register an object to handle optionMenu events.
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
intgetHistory()
Retrieves the index of the currently selected menu item.
MenugetMenu()
Returns the Menu associated with this OptionMenu.
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidremoveListener(OptionMenuListener listener)
Removes a listener
voidremoveMenu()
Removes the Menu from the OptionMenu
voidsetHistory(int index)
Selects the menu item specified by index making it the newly selected value for the option menu.
voidsetMenu(Menu menu)
Provides the Menu that is popped up to allow the user to choose a new value.

Constructor Detail

OptionMenu

public OptionMenu()
Create a new OptionMenu.

OptionMenu

public OptionMenu(Handle handle)
Construct an OptionMenu using a handle to a native resource.

Method Detail

addListener

public void addListener(OptionMenuListener listener)
Register an object to handle optionMenu events.

See Also: OptionMenuListener

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getHistory

public int getHistory()
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

getMenu

public Menu getMenu()
Returns the Menu associated with this OptionMenu.

Returns: The Menu associated with this OptionMenu.

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.

removeListener

public void removeListener(OptionMenuListener listener)
Removes a listener

See Also: addListener

removeMenu

public void removeMenu()
Removes the Menu from the OptionMenu

setHistory

public void setHistory(int index)
Selects the menu item specified by index making it the newly selected value for the option menu.

Parameters: index the index of the menu item to select. Index values are from 0 to n-1.

setMenu

public void setMenu(Menu menu)
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.

Parameters: menu The Menu to add to the OptionMenu.