org.gnu.gtk
Class MenuItem
The MenuItem widget and derived widgets are the only valid children for
Menus. Their function is to correctly handle highlighting, alignment, events,
and submenus.
MenuItem() - Construct a new menu item.
|
MenuItem(Handle handle) - Create a new MenuItem with a handle to a native resource returned from a
call to the native libraries.
|
MenuItem(String label, boolean hasMnemonic) - Construct a new menu item with the provided label.
|
add , addListener , getBooleanChildProperty , getBorderWidth , getChildProperty , getChildren , getEventListenerClass , getEventType , getIntChildProperty , getResizeMode , getType , remove , removeListener , resizeChildren , setBooleanChildProperty , setBorderWidth , setChildProperty , setIntChildProperty , setResizeMode |
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 , getEventListenerClass , getEventType , getExtensionEvents , getModifierStyle , getName , getParent , getParentWindow , getPointer , getRootWindow , getScreen , getSensitive , getStyle , getToplevel , getType , 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 |
MenuItem
public MenuItem()
Construct a new menu item.
MenuItem
public MenuItem(Handle handle)
Create a new MenuItem with a handle to a native resource returned from a
call to the native libraries. Should only be used internally by
Java-Gnome.
handle
- The handle that represents a pointer to a native resource.
MenuItem
public MenuItem(String label,
boolean hasMnemonic)
Construct a new menu item with the provided label.
label
- The label to display in the menu item.hasMnemonic
- Indicates if the provided string contains mnemonics
addListener
public void addListener(MenuItemListener listener)
Register an object to receive event notification.
listener
- The object that has implemented the MenuItemListener interface
that is to receive the menu item events.
emitActivate
public void emitActivate()
Emits the "activate" signal on this MenuItem.
emitDeselect
public void emitDeselect()
Emits the "deselect" signal on this MenuItem.
getEventType
public EventType getEventType(String signal)
- getEventType in interface Item
getMenuItem
public static MenuItem getMenuItem(Handle handle)
Create a new MenuItem with a handle to a native resource returned from a
call to the native libraries. Should only be used internally by
Java-Gnome.
handle
- The handle that represents a pointer to a native resource.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
- getType in interface Item
removeListener
public void removeListener(MenuItemListener listener)
Unregister an object that was receiving menuitem event notification.
listener
- The object that is to no longer receive menuitem events.
removeSubmenu
public void removeSubmenu()
Removes the widget's submenu.
setLeftJustified
public void setLeftJustified()
MenuItem's are left justified by default. Use this method to change a
MenuItem from right justified back to left justified.
setRightJustified
public void setRightJustified()
Sets whether the menu item appears to the right side of the menu bar.
This was traditionally done for the Help menu, but is now considered a
bad idea. (If the widget layout is reversed for a right to left language
like Hebrew or Arabic, right-justified menu items appear at the left).
setSubmenu
public void setSubmenu(Menu submenu)
Sets the submenu, or changes it.