org.gnu.gtk
Class Menu

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.gtk.GtkObject
              extended by org.gnu.gtk.Widget
                  extended by org.gnu.gtk.Container
                      extended by org.gnu.gtk.MenuShell
                          extended by org.gnu.gtk.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(org.gnu.glib.Handle handle)
          Create a new Menu from a handle to a native resource.
 
Method Summary
 void detach()
          Detaches the menu from the widget to which it had been attached.
 java.util.ArrayList getAttachedMenus()
          Returns a list of the menus which are attached to this widget.
static Menu getMenu(org.gnu.glib.Handle handle)
          Create a new Menu from a handle to a native resource.
 java.lang.String getTitle()
          Returns the title of the menu.
static Type getType()
          Retrieve the runtime type used by the GLib library.
 void popup()
          Displays a menu and makes it available for selection.
 void reorderMenuItem(MenuItem child, int position)
          Move a MenuItem to a new position within the Menu.
 void setAccelGroup(AccelGroup accelGroup)
          Set the AccelGroup which holds global accelerators for the menu.
 void setTitle(java.lang.String title)
          Sets the title string for this Menu.
 
Methods inherited from class org.gnu.gtk.MenuShell
activateItem, append, cancel, deactivate, deselect, getTakeFocus, insert, prepend, selectFirst, selectItem, setTakeFocus
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, getBooleanChildProperty, getBorderWidth, getChildProperty, getChildren, getEventListenerClass, getEventType, getIntChildProperty, getResizeMode, remove, removeListener, resizeChildren, setBooleanChildProperty, setBorderWidth, setChildProperty, setIntChildProperty, setResizeMode
 
Methods inherited from class org.gnu.gtk.Widget
activate, addAccelerator, addEvents, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, draw, drawArea, drawArea, finish, getAccessible, getAllocation, getCanFocus, getColormap, getContext, getData, getDisplay, getDragData, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getWidget, getWindow, grabDefault, grabFocus, hasFocus, hasScreen, hide, hideAll, highlight, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeAccelerator, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setCanFocus, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setEvents, setExtensionEvents, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight, unHighlight
 
Methods inherited from class org.gnu.gtk.GtkObject
destroy, sink
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Menu

public Menu()
Create a new Menu.


Menu

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

Method Detail

getMenu

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


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.

popup

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


detach

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


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(java.lang.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.

getTitle

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

Returns:
The title for the menu.

getAttachedMenus

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


getType

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