org.gnu.gtk

Class Menu

public class Menu extends MenuShell

A Menu is a MenuShell that implements a drop down menu consisting of a list of MenuItem objects which can be navigated and activated by the user to perform application functions.
Constructor Summary
Menu()
Create a new Menu.
Menu(Handle handle)
Create a new Menu from a handle to a native resource.
Method Summary
voiddetach()
Detaches the menu from the widget to which it had been attached.
ArrayListgetAttachedMenus()
Returns a list of the menus which are attached to this widget.
static MenugetMenu(Handle handle)
Create a new Menu from a handle to a native resource.
StringgetTitle()
Returns the title of the menu.
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidpopup()
Displays a menu and makes it available for selection.
voidreorderMenuItem(MenuItem child, int position)
Move a MenuItem to a new position within the Menu.
voidsetAccelGroup(AccelGroup accelGroup)
Set the AccelGroup which holds global accelerators for the menu.
voidsetTitle(String title)
Sets the title string for this Menu.

Constructor Detail

Menu

public Menu()
Create a new Menu.

Menu

public Menu(Handle handle)
Create a new Menu from a handle to a native resource.

Method Detail

detach

public void detach()
Detaches the menu from the widget to which it had been attached.

getAttachedMenus

public ArrayList getAttachedMenus()
Returns a list of the menus which are attached to this widget.

getMenu

public static Menu getMenu(Handle handle)
Create a new Menu from a handle to a native resource.

getTitle

public String getTitle()
Returns the title of the menu.

Returns: The title for the menu.

getType

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

popup

public void popup()
Displays a menu and makes it available for selection. Applications can use this method to provide context-sensitive menus.

reorderMenuItem

public void reorderMenuItem(MenuItem child, int position)
Move a MenuItem to a new position within the Menu.

Parameters: child The MenuItem to be moved. position The new position to place the MenuItem.

setAccelGroup

public void setAccelGroup(AccelGroup accelGroup)
Set the AccelGroup which holds global accelerators for the menu. The accelerator group needs to also be added to all windows that this menu is being used in.

Parameters: accelGroup The AccelGroup to be associated with this Menu.

setTitle

public void setTitle(String title)
Sets the title string for this Menu. The title is displayed when the menu is shown as a tearoff menu.

Parameters: title The title for the Menu.