org.gnu.gtk

Class OptionMenu

public class OptionMenu extends Button

Deprecated: Replaced by ComboBox in gtk 2.3 This class is part of the java-gnome 2.x family of libraries, which, due to their inefficiency and complexity, are no longer being maintained and have been abandoned by the java-gnome project. This class may in the future have an equivalent in java-gnome 4.0, try looking for org.gnome.gtk.OptionMenu. You should be aware that there is a considerably different API in the new library: the architecture is completely different and most notably internals are no longer exposed to public view.

deprecated menu widget replaced by 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()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Create a new OptionMenu.

OptionMenu

public OptionMenu(Handle handle)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Construct an OptionMenu using a handle to a native resource.

Method Detail

addListener

public void addListener(OptionMenuListener listener)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

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()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

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()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Returns the Menu associated with this OptionMenu.

Returns: The Menu associated with this OptionMenu.

getType

public static Type getType()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Retrieve the runtime type used by the GLib library.

removeListener

public void removeListener(OptionMenuListener listener)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Removes a listener

See Also: addListener

removeMenu

public void removeMenu()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Removes the Menu from the OptionMenu

setHistory

public void setHistory(int index)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

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)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

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.