org.gnu.gtk
Class Menu

java.lang.Object
  |
  +--org.gnu.glib.GObject
        |
        +--org.gnu.gtk.GtkObject
              |
              +--org.gnu.gtk.Widget
                    |
                    +--org.gnu.gtk.Container
                          |
                          +--org.gnu.gtk.MenuShell
                                |
                                +--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(int 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.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, deactivate, deselect, insert, prepend, selectItem
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, getBorderWidth, getEventListenerClass, getEventType, getResizeMode, remove, removeListener, resizeChildren, setBorderWidth, setResizeMode
 
Methods inherited from class org.gnu.gtk.Widget
activate, addListener, addListener, addListener, addListener, addListener, addListener, createContext, createLayout, destroy, draw, drawArea, drawArea, getAccessible, getColormap, getContext, getModifierStyle, getName, getParent, getParentWindow, getPointer, getSensitive, getStyle, getToplevel, grabDefault, grabFocus, hasFocus, hide, hideAll, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setColormap, setDoubleBuffered, setDragDestination, setDragSource, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, equals, getData, getHandle, removeEventHandler, setData
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Menu

public Menu()
Create a new Menu.


Menu

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

Method Detail

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.

getType

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


Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net