Note
Only one of BAR, DROP_DOWN and POP_UP may be specified. Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified.
Important Note
This class is not intended to be subclassed.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv long | actionGroup
GTK4 only fields |
| pack-priv MenuItem | |
| pack-priv boolean | |
| pack-priv ImageList | |
| pack-priv LinkedList | |
| pack-priv long | |
| pack-priv long | modelHandle
GTK4 only fields |
| pack-priv Decorations | |
| pack-priv int | |
| pack-priv LinkedList | |
| pack-priv MenuItem | |
| pack-priv long | shortcutController
GTK4 only fields |
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Menu(Decorations
a decorations control which will be the parent of the new instance (cannot be null) parent, int the style of menu to construct style)Constructs a new instance of this class given its parent
(which must be a |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | |
| pack-priv boolean | Returns: true iff the location of menu is set and can be used successfullyBug 532074: setLocation method is limited on Wayland since Wayland has no global coordinates and we cannot use gdk_popup_at_rect if GdkWindow of getShell is not mapped. |
| pack-priv void | |
| public void | addHelpListener(HelpListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will
be notified when help events are generated for the control,
by sending it one of the messages defined in the
|
| public void | addMenuListener(MenuListener
the listener which should be notified listener)Adds the listener to the collection of listeners who will
be notified when menus are hidden or shown, by sending it
one of the messages defined in the |
| pack-priv void | adjustParentWindowWayland(long
a pointer to the GdkEvent eventPtr)Lack of absolute coordinates make Wayland event windows inaccurate. |
| pack-priv static Control | |
| pack-priv static Menu | |
| pack-priv static MenuItem | |
| pack-priv static int | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | destroyWidget()
Overrides org. |
| pack-priv void | |
| public MenuItem | Returns: the default menu item.Returns the default menu item or null if none has been previously set. |
| public boolean | Returns: the receiver's enabled stateReturns |
| public MenuItem | Returns: the item at the given indexthe index of the item to return index)Returns the item at the given, zero-relative index in the receiver. |
| public int | |
| public MenuItem[] | Returns: the items in the receiverReturns a (possibly empty) array of |
| pack-priv String | |
| public int | Returns: the orientation styleReturns the orientation of the receiver, which will be one of the
constants |
| public Decorations | Returns: the receiver's parentReturns the receiver's parent, which must be a |
| public MenuItem | Returns: the receiver's parent itemReturns the receiver's parent item, which must be a
|
| public Menu | Returns: the receiver's parent itemReturns the receiver's parent item, which must be a
|
| public Shell | |
| public boolean | Returns: the receiver's visibility stateReturns |
| pack-priv long | |
| pack-priv long | |
| pack-priv long | gtk_menu_popped_up(long
the memory address of the menu which was popped up widget, long a pointer to the GdkRectangle containing the flipped location and size of the menu flipped_rect, long a pointer to the GdkRectangle containing the final (after all internal adjustments)
location and size of the menu final_rect, long a boolean flag indicating whether the menu has been inverted along the X-axis flipped_x, long a boolean flag indicating whether the menu has been inverted along the Y-axis flipped_y)Overrides org. GTK3.22+ has API which allows clients of GTK to connect a menu to the "popped-up" signal. |
| pack-priv long | |
| pack-priv void | |
| public int | |
| public boolean | Returns: the receiver's enabled stateReturns |
| public boolean | Returns: the receiver's visibility stateReturns |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | removeHelpListener(HelpListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the help events are generated for the control. |
| public void | removeMenuListener(MenuListener
the listener which should no longer be notified listener)Removes the listener from the collection of listeners who will be notified when the menu events are generated for the control. |
| pack-priv void | |
| pack-priv boolean | |
| public void | setDefaultItem(MenuItem
the default menu item or null item)Sets the default menu item to the argument or removes
the default emphasis when the argument is |
| public void | setEnabled(boolean
the new enabled state enabled)Enables the receiver if the argument is |
| public void | setLocation(int
the new x coordinate for the receiver x, int the new y coordinate for the receiver y)Sets the location of the receiver, which must be a popup, to the point specified by the arguments which are relative to the display. |
| public void | setLocation(Point
the new location for the receiver location)Sets the location of the receiver, which must be a popup, to the point specified by the argument which is relative to the display. |
| pack-priv void | |
| pack-priv void | |
| public void | setOrientation(int
new orientation style orientation)Sets the orientation of the receiver, which must be one
of the constants |
| pack-priv void | |
| public void | setVisible(boolean
the new visibility state visible)Marks the receiver as visible if the argument is |
| pack-priv void | verifyMenuPosition(int
the current number of items in the menu, just
before it's about to be shown/popped-up itemCount)Feature in GTK3 on X11: context menus in SWT are populated dynamically, sometimes asynchronously outside of SWT (i.e. in Platform UI). |