Gtk.Menu¶
- Subclasses:
Methods¶
- Inherited:
Gtk.MenuShell (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The accel group holding accelerators for the menu |
||
r/w |
An accel path used to conveniently construct accel paths of child items |
||
r/w |
The currently selected menu item |
||
r/w/c/en |
Positioning hints for when the menu might fall off-screen |
||
r/w |
The widget the menu is attached to |
||
r/w/c/en |
Menu window type hint |
||
r/w/en |
The monitor the menu will be popped up on |
||
r/w/c/en |
Rect anchor horizontal offset |
||
r/w/c/en |
Rect anchor vertical offset |
||
r/w/en |
A boolean that indicates whether the menu reserves space for toggles and icons |
||
d/r/w |
A boolean that indicates whether the menu is torn-off |
||
d/r/w |
A title that may be displayed by the window manager when this menu is torn-off |
Child Properties¶
Name |
Type |
Default |
Flags |
Short Description |
---|---|---|---|---|
|
|
r/w |
The row number to attach the bottom of the child to |
|
|
|
r/w |
The column number to attach the left side of the child to |
|
|
|
r/w |
The column number to attach the right side of the child to |
|
|
|
r/w |
The row number to attach the top of the child to |
Style Properties¶
- Inherited:
Name |
Type |
Default |
Flags |
Short Description |
---|---|---|---|---|
|
d/r |
Indicates where scroll arrows should be placed |
||
|
|
d/r |
Arbitrary constant to scale down the size of the scroll arrow |
|
|
d/r |
When scrolling, always show both arrows. |
||
|
|
r |
When the menu is a submenu, position it this number of pixels offset horizontally |
|
|
|
d/r |
Extra space at the left and right edges of the menu |
|
|
|
r |
When the menu is a submenu, position it this number of pixels offset vertically |
|
|
|
d/r |
Extra space at the top and bottom of the menu |
Signals¶
- Inherited:
Gtk.MenuShell (8), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Short Description |
---|---|
Emitted when the position of menu is finalized after being popped up using |
Fields¶
- Inherited:
Gtk.MenuShell (8), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Type |
Access |
Description |
---|---|---|---|
menu_shell |
r |
Class Details¶
- class Gtk.Menu(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
Gtk.Menu
is aGtk.MenuShell
that implements a drop down menu consisting of a list ofGtk.MenuItem
objects which can be navigated and activated by the user to perform application functions.A
Gtk.Menu
is most commonly dropped down by activating aGtk.MenuItem
in aGtk.MenuBar
or popped up by activating aGtk.MenuItem
in anotherGtk.Menu
.A
Gtk.Menu
can also be popped up by activating aGtk.ComboBox
. Other composite widgets such as theGtk.Notebook
can pop up aGtk.Menu
as well.Applications can display a
Gtk.Menu
as a popup menu by calling theGtk.Menu.popup
() function. The example below shows how an application can pop up a menu when the 3rd mouse button is pressed.- Connecting the popup signal handler.
// connect our handler which will popup the menu g_signal_connect_swapped (window, "button_press_event", G_CALLBACK (my_popup_handler), menu);
- Signal handler which displays a popup menu.
static gint my_popup_handler (GtkWidget *widget, GdkEvent *event) { GtkMenu *menu; GdkEventButton *event_button; g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (GTK_IS_MENU (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); // The "widget" is the menu that was supplied when // g_signal_connect_swapped() was called. menu = GTK_MENU (widget); if (event->type == GDK_BUTTON_PRESS) { event_button = (GdkEventButton *) event; if (event_button->button == GDK_BUTTON_SECONDARY) { gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event_button->button, event_button->time); return TRUE; } } return FALSE; }
- CSS nodes
menu ├── arrow.top ├── <child> ┊ ├── <child> ╰── arrow.bottom
The main CSS node of
Gtk.Menu
has name menu, and there are two subnodes with name arrow, for scrolling menu arrows. These subnodes get the .top and .bottom style classes.- classmethod get_for_attach_widget(widget)[source]¶
- Parameters:
widget (
Gtk.Widget
) – aGtk.Widget
- Returns:
the list of menus attached to his widget.
- Return type:
Returns a list of the menus which are attached to this widget. This list is owned by GTK+ and must not be modified.
New in version 2.6.
- classmethod new_from_model(model)[source]¶
- Parameters:
model (
Gio.MenuModel
) – aGio.MenuModel
- Returns:
a new
Gtk.Menu
- Return type:
Creates a
Gtk.Menu
and populates it with menu items and submenus according to model.The created menu items are connected to actions found in the
Gtk.ApplicationWindow
to which the menu belongs - typically by means of being attached to a widget (seeGtk.Menu.attach_to_widget
()) that is contained within theGtk.ApplicationWindows
widget hierarchy.Actions can also be added using
Gtk.Widget.insert_action_group
() on the menu’s attach widget or on any of its parent widgets.New in version 3.4.
- attach(child, left_attach, right_attach, top_attach, bottom_attach)[source]¶
- Parameters:
child (
Gtk.Widget
) – aGtk.MenuItem
left_attach (
int
) – The column number to attach the left side of the item toright_attach (
int
) – The column number to attach the right side of the item totop_attach (
int
) – The row number to attach the top of the item tobottom_attach (
int
) – The row number to attach the bottom of the item to
Adds a new
Gtk.MenuItem
to a (table) menu. The number of “cells” that an item will occupy is specified by left_attach, right_attach, top_attach and bottom_attach. These each represent the leftmost, rightmost, uppermost and lower column and row numbers of the table. (Columns and rows are indexed from zero).Note that this function is not related to
Gtk.Menu.detach
().New in version 2.4.
- attach_to_widget(attach_widget, detacher)[source]¶
- Parameters:
attach_widget (
Gtk.Widget
) – theGtk.Widget
that the menu will be attached todetacher (
Gtk.MenuDetachFunc
orNone
) – the user supplied callback function that will be called when the menu callsGtk.Menu.detach
()
Attaches the menu to the widget and provides a callback function that will be invoked when the menu calls
Gtk.Menu.detach
() during its destruction.If the menu is attached to the widget then it will be destroyed when the widget is destroyed, as if it was a child widget. An attached menu will also move between screens correctly if the widgets moves between screens.
- detach()[source]¶
Detaches the menu from the widget to which it had been attached. This function will call the callback function, detacher, provided when the
Gtk.Menu.attach_to_widget
() function was called.
- get_accel_group()[source]¶
- Returns:
the
Gtk.AccelGroup
associated with the menu- Return type:
Gets the
Gtk.AccelGroup
which holds global accelerators for the menu. SeeGtk.Menu.set_accel_group
().
- get_accel_path()[source]¶
- Returns:
the accelerator path set on the menu.
- Return type:
Retrieves the accelerator path set on the menu.
New in version 2.14.
- get_active()[source]¶
- Returns:
the
Gtk.MenuItem
that was last selected in the menu. If a selection has not yet been made, the first menu item is selected.- Return type:
Returns the selected menu item from the menu. This is used by the
Gtk.ComboBox
.
- get_attach_widget()[source]¶
- Returns:
the
Gtk.Widget
that the menu is attached to- Return type:
Returns the
Gtk.Widget
that the menu is attached to.
- get_monitor()[source]¶
- Returns:
the number of the monitor on which the menu should be popped up or -1, if no monitor has been set
- Return type:
Retrieves the number of the monitor on which to show the menu.
New in version 2.14.
- get_reserve_toggle_size()[source]¶
- Returns:
Whether the menu reserves toggle space
- Return type:
Returns whether the menu reserves space for toggles and icons, regardless of their actual presence.
New in version 2.18.
- get_tearoff_state()[source]¶
-
Returns whether the menu is torn off. See
Gtk.Menu.set_tearoff_state
().Deprecated since version 3.10.
- get_title()[source]¶
- Returns:
the title of the menu, or
None
if the menu has no title set on it. This string is owned by GTK+ and should not be modified or freed.- Return type:
Returns the title of the menu. See
Gtk.Menu.set_title
().Deprecated since version 3.10.
- place_on_monitor(monitor)[source]¶
- Parameters:
monitor (
Gdk.Monitor
) – the monitor to place the menu on
Places self on the given monitor.
New in version 3.22.
- popup(parent_menu_shell, parent_menu_item, func, data, button, activate_time)[source]¶
- Parameters:
parent_menu_shell (
Gtk.Widget
orNone
) – the menu shell containing the triggering menu item, orNone
parent_menu_item (
Gtk.Widget
orNone
) – the menu item whose activation triggered the popup, orNone
func (
Gtk.MenuPositionFunc
orNone
) – a user supplied function used to position the menu, orNone
data (
object
orNone
) – user supplied data to be passed to func.button (
int
) – the mouse button which was pressed to initiate the event.activate_time (
int
) – the time at which the activation event occurred.
Displays a menu and makes it available for selection.
Applications can use this function to display context-sensitive menus, and will typically supply
None
for the parent_menu_shell, parent_menu_item, func and data parameters. The default menu positioning function will position the menu at the current mouse cursor position.The button parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, button should be 0.
The activate_time parameter is used to conflict-resolve initiation of concurrent requests for mouse/keyboard grab requests. To function properly, this needs to be the timestamp of the user event (such as a mouse click or key press) that caused the initiation of the popup. Only if no such event is available,
Gtk.get_current_event_time
() can be used instead.Note that this function does not work very well on GDK backends that do not have global coordinates, such as Wayland or Mir. You should probably use one of the gtk_menu_popup_at_ variants, which do not have this problem.
Deprecated since version 3.22: Please use
Gtk.Menu.popup_at_widget
(),Gtk.Menu.popup_at_pointer
(). orGtk.Menu.popup_at_rect
() instead
- popup_at_pointer(trigger_event)[source]¶
- Parameters:
trigger_event (
Gdk.Event
orNone
) – theGdk.Event
that initiated this request orNone
if it’s the current event
Displays self and makes it available for selection.
See
Gtk.Menu.popup_at_widget
() to pop up a menu at a widget.Gtk.Menu.popup_at_rect
() also allows you to position a menu at an arbitrary rectangle.self will be positioned at the pointer associated with trigger_event.
Properties that influence the behaviour of this function are
Gtk.Menu
:anchor-hints
,Gtk.Menu
:rect-anchor-dx
,Gtk.Menu
:rect-anchor-dy
, andGtk.Menu
:menu-type-hint
. Connect to theGtk.Menu
::popped-up
signal to find out how it was actually positioned.New in version 3.22.
- popup_at_rect(rect_window, rect, rect_anchor, menu_anchor, trigger_event)[source]¶
- Parameters:
rect_window (
Gdk.Window
) – theGdk.Window
rect is relative torect (
Gdk.Rectangle
) – theGdk.Rectangle
to align self withrect_anchor (
Gdk.Gravity
) – the point on rect to align with self's anchor pointmenu_anchor (
Gdk.Gravity
) – the point on self to align with rect's anchor pointtrigger_event (
Gdk.Event
orNone
) – theGdk.Event
that initiated this request orNone
if it’s the current event
Displays self and makes it available for selection.
See
Gtk.Menu.popup_at_widget
() andGtk.Menu.popup_at_pointer
(), which handle more common cases for popping up menus.self will be positioned at rect, aligning their anchor points. rect is relative to the top-left corner of rect_window. rect_anchor and menu_anchor determine anchor points on rect and self to pin together. self can optionally be offset by
Gtk.Menu
:rect-anchor-dx
andGtk.Menu
:rect-anchor-dy
.Anchors should be specified under the assumption that the text direction is left-to-right; they will be flipped horizontally automatically if the text direction is right-to-left.
Other properties that influence the behaviour of this function are
Gtk.Menu
:anchor-hints
andGtk.Menu
:menu-type-hint
. Connect to theGtk.Menu
::popped-up
signal to find out how it was actually positioned.New in version 3.22.
- popup_at_widget(widget, widget_anchor, menu_anchor, trigger_event)[source]¶
- Parameters:
widget (
Gtk.Widget
) – theGtk.Widget
to align self withwidget_anchor (
Gdk.Gravity
) – the point on widget to align with self's anchor pointmenu_anchor (
Gdk.Gravity
) – the point on self to align with widget's anchor pointtrigger_event (
Gdk.Event
orNone
) – theGdk.Event
that initiated this request orNone
if it’s the current event
Displays self and makes it available for selection.
See
Gtk.Menu.popup_at_pointer
() to pop up a menu at the master pointer.Gtk.Menu.popup_at_rect
() also allows you to position a menu at an arbitrary rectangle.self will be positioned at widget, aligning their anchor points. widget_anchor and menu_anchor determine anchor points on widget and self to pin together. self can optionally be offset by
Gtk.Menu
:rect-anchor-dx
andGtk.Menu
:rect-anchor-dy
.Anchors should be specified under the assumption that the text direction is left-to-right; they will be flipped horizontally automatically if the text direction is right-to-left.
Other properties that influence the behaviour of this function are
Gtk.Menu
:anchor-hints
andGtk.Menu
:menu-type-hint
. Connect to theGtk.Menu
::popped-up
signal to find out how it was actually positioned.New in version 3.22.
- popup_for_device(device, parent_menu_shell, parent_menu_item, func, data, button, activate_time)[source]¶
- Parameters:
device (
Gdk.Device
orNone
) – aGdk.Device
parent_menu_shell (
Gtk.Widget
orNone
) – the menu shell containing the triggering menu item, orNone
parent_menu_item (
Gtk.Widget
orNone
) – the menu item whose activation triggered the popup, orNone
func (
Gtk.MenuPositionFunc
orNone
) – a user supplied function used to position the menu, orNone
data (
object
orNone
) – user supplied data to be passed to funcbutton (
int
) – the mouse button which was pressed to initiate the eventactivate_time (
int
) – the time at which the activation event occurred
Displays a menu and makes it available for selection.
Applications can use this function to display context-sensitive menus, and will typically supply
None
for the parent_menu_shell, parent_menu_item, func, data and destroy parameters. The default menu positioning function will position the menu at the current position of device (or its corresponding pointer).The button parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, button should be 0.
The activate_time parameter is used to conflict-resolve initiation of concurrent requests for mouse/keyboard grab requests. To function properly, this needs to be the time stamp of the user event (such as a mouse click or key press) that caused the initiation of the popup. Only if no such event is available,
Gtk.get_current_event_time
() can be used instead.Note that this function does not work very well on GDK backends that do not have global coordinates, such as Wayland or Mir. You should probably use one of the gtk_menu_popup_at_ variants, which do not have this problem.
New in version 3.0.
Deprecated since version 3.22: Please use
Gtk.Menu.popup_at_widget
(),Gtk.Menu.popup_at_pointer
(). orGtk.Menu.popup_at_rect
() instead
- reorder_child(child, position)[source]¶
- Parameters:
child (
Gtk.Widget
) – theGtk.MenuItem
to moveposition (
int
) – the new position to place child. Positions are numbered from 0 to n - 1
Moves child to a new position in the list of self children.
- set_accel_group(accel_group)[source]¶
- Parameters:
accel_group (
Gtk.AccelGroup
orNone
) – theGtk.AccelGroup
to be associated with the menu.
Set the
Gtk.AccelGroup
which holds global accelerators for the menu. This accelerator group needs to also be added to all windows that this menu is being used in withGtk.Window.add_accel_group
(), in order for those windows to support all the accelerators contained in this group.
- set_accel_path(accel_path)[source]¶
-
Sets an accelerator path for this menu from which accelerator paths for its immediate children, its menu items, can be constructed. The main purpose of this function is to spare the programmer the inconvenience of having to call
Gtk.MenuItem.set_accel_path
() on each menu item that should support runtime user changable accelerators. Instead, by just callingGtk.Menu.set_accel_path
() on their parent, each menu item of this menu, that contains a label describing its purpose, automatically gets an accel path assigned.For example, a menu containing menu items “New” and “Exit”, will, after
gtk_menu_set_accel_path (menu, "<Gnumeric-Sheet>/File");
has been called, assign its items the accel paths:"<Gnumeric-Sheet>/File/New"
and"<Gnumeric-Sheet>/File/Exit"
.Assigning accel paths to menu items then enables the user to change their accelerators at runtime. More details about accelerator paths and their default setups can be found at
Gtk.AccelMap.add_entry
().Note that accel_path string will be stored in a #GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with
GLib.intern_static_string
().
- set_active(index)[source]¶
- Parameters:
index (
int
) – the index of the menu item to select. Index values are from 0 to n-1
Selects the specified menu item within the menu. This is used by the
Gtk.ComboBox
and should not be used by anyone else.
- set_monitor(monitor_num)[source]¶
- Parameters:
monitor_num (
int
) – the number of the monitor on which the menu should be popped up
Informs GTK+ on which monitor a menu should be popped up. See
Gdk.Monitor.get_geometry
().This function should be called from a
Gtk.MenuPositionFunc
if the menu should not appear on the same monitor as the pointer. This information can’t be reliably inferred from the coordinates returned by aGtk.MenuPositionFunc
, since, for very long menus, these coordinates may extend beyond the monitor boundaries or even the screen boundaries.New in version 2.4.
- set_reserve_toggle_size(reserve_toggle_size)[source]¶
- Parameters:
reserve_toggle_size (
bool
) – whether to reserve size for toggles
Sets whether the menu should reserve space for drawing toggles or icons, regardless of their actual presence.
New in version 2.18.
- set_screen(screen)[source]¶
- Parameters:
screen (
Gdk.Screen
orNone
) – aGdk.Screen
, orNone
if the screen should be determined by the widget the menu is attached to
Sets the
Gdk.Screen
on which the menu will be displayed.New in version 2.2.
- set_tearoff_state(torn_off)[source]¶
-
Changes the tearoff state of the menu. A menu is normally displayed as drop down menu which persists as long as the menu is active. It can also be displayed as a tearoff menu which persists until it is closed or reattached.
Deprecated since version 3.10.
- set_title(title)[source]¶
- Parameters:
title (
str
orNone
) – a string containing the title for the menu, orNone
to inherit the title of the parent menu item, if any
Sets the title string for the menu.
The title is displayed when the menu is shown as a tearoff menu. If title is
None
, the menu will see if it is attached to a parent menu item, and if so it will try to use the same text as that menu item’s label.Deprecated since version 3.10.
Signal Details¶
- Gtk.Menu.signals.move_scroll(menu, scroll_type)¶
- Signal Name:
move-scroll
- Flags:
- Parameters:
menu (
Gtk.Menu
) – The object which received the signalscroll_type (
Gtk.ScrollType
) – aGtk.ScrollType
- Gtk.Menu.signals.popped_up(menu, flipped_rect, final_rect, flipped_x, flipped_y)¶
- Signal Name:
popped-up
- Flags:
- Parameters:
menu (
Gtk.Menu
) – The object which received the signalflipped_rect (
object
orNone
) – the position of menu after any possible flipping orNone
if the backend can’t obtain itfinal_rect (
object
orNone
) – the final position of menu orNone
if the backend can’t obtain itflipped_x (
bool
) –True
if the anchors were flipped horizontallyflipped_y (
bool
) –True
if the anchors were flipped vertically
Emitted when the position of menu is finalized after being popped up using
Gtk.Menu.popup_at_rect
(),Gtk.Menu.popup_at_widget
(), orGtk.Menu.popup_at_pointer
().menu might be flipped over the anchor rectangle in order to keep it on-screen, in which case flipped_x and flipped_y will be set to
True
accordingly.flipped_rect is the ideal position of menu after any possible flipping, but before any possible sliding. final_rect is flipped_rect, but possibly translated in the case that flipping is still ineffective in keeping menu on-screen.
The blue menu is menu's ideal position, the green menu is flipped_rect, and the red menu is final_rect.
See
Gtk.Menu.popup_at_rect
(),Gtk.Menu.popup_at_widget
(),Gtk.Menu.popup_at_pointer
(),Gtk.Menu
:anchor-hints
,Gtk.Menu
:rect-anchor-dx
,Gtk.Menu
:rect-anchor-dy
, andGtk.Menu
:menu-type-hint
.New in version 3.22.
Property Details¶
- Gtk.Menu.props.accel_group¶
- Name:
accel-group
- Type:
- Default Value:
- Flags:
The accel group holding accelerators for the menu.
New in version 2.14.
- Gtk.Menu.props.accel_path¶
-
An accel path used to conveniently construct accel paths of child items.
New in version 2.14.
- Gtk.Menu.props.active¶
-
The index of the currently selected menu item, or -1 if no menu item is selected.
New in version 2.14.
- Gtk.Menu.props.anchor_hints¶
- Name:
anchor-hints
- Type:
- Default Value:
Gdk.AnchorHints.FLIP_X
|Gdk.AnchorHints.FLIP_Y
|Gdk.AnchorHints.SLIDE_X
|Gdk.AnchorHints.SLIDE_Y
|Gdk.AnchorHints.RESIZE_X
|Gdk.AnchorHints.RESIZE_Y
|Gdk.AnchorHints.FLIP
|Gdk.AnchorHints.SLIDE
|Gdk.AnchorHints.RESIZE
- Flags:
Positioning hints for aligning the menu relative to a rectangle.
These hints determine how the menu should be positioned in the case that the menu would fall off-screen if placed in its ideal position.
For example,
Gdk.AnchorHints.FLIP_Y
will replaceGdk.Gravity.NORTH_WEST
withGdk.Gravity.SOUTH_WEST
and vice versa if the menu extends beyond the bottom edge of the monitor.See
Gtk.Menu.popup_at_rect
(),Gtk.Menu.popup_at_widget
(),Gtk.Menu.popup_at_pointer
(),Gtk.Menu
:rect-anchor-dx
,Gtk.Menu
:rect-anchor-dy
,Gtk.Menu
:menu-type-hint
, andGtk.Menu
::popped-up
.New in version 3.22.
- Gtk.Menu.props.attach_widget¶
- Name:
attach-widget
- Type:
- Default Value:
- Flags:
The widget the menu is attached to. Setting this property attaches the menu without a
Gtk.MenuDetachFunc
. If you need to use a detacher, useGtk.Menu.attach_to_widget
() directly.New in version 2.14.
- Gtk.Menu.props.menu_type_hint¶
- Name:
menu-type-hint
- Type:
- Default Value:
- Flags:
The
Gdk.WindowTypeHint
to use for the menu’sGdk.Window
.See
Gtk.Menu.popup_at_rect
(),Gtk.Menu.popup_at_widget
(),Gtk.Menu.popup_at_pointer
(),Gtk.Menu
:anchor-hints
,Gtk.Menu
:rect-anchor-dx
,Gtk.Menu
:rect-anchor-dy
, andGtk.Menu
::popped-up
.New in version 3.22.
- Gtk.Menu.props.monitor¶
- Name:
monitor
- Type:
- Default Value:
-1
- Flags:
The monitor the menu will be popped up on.
New in version 2.14.
- Gtk.Menu.props.rect_anchor_dx¶
- Name:
rect-anchor-dx
- Type:
- Default Value:
0
- Flags:
Horizontal offset to apply to the menu, i.e. the rectangle or widget anchor.
See
Gtk.Menu.popup_at_rect
(),Gtk.Menu.popup_at_widget
(),Gtk.Menu.popup_at_pointer
(),Gtk.Menu
:anchor-hints
,Gtk.Menu
:rect-anchor-dy
,Gtk.Menu
:menu-type-hint
, andGtk.Menu
::popped-up
.New in version 3.22.
- Gtk.Menu.props.rect_anchor_dy¶
- Name:
rect-anchor-dy
- Type:
- Default Value:
0
- Flags:
Vertical offset to apply to the menu, i.e. the rectangle or widget anchor.
See
Gtk.Menu.popup_at_rect
(),Gtk.Menu.popup_at_widget
(),Gtk.Menu.popup_at_pointer
(),Gtk.Menu
:anchor-hints
,Gtk.Menu
:rect-anchor-dx
,Gtk.Menu
:menu-type-hint
, andGtk.Menu
::popped-up
.New in version 3.22.
- Gtk.Menu.props.reserve_toggle_size¶
- Name:
reserve-toggle-size
- Type:
- Default Value:
- Flags:
A boolean that indicates whether the menu reserves space for toggles and icons, regardless of their actual presence.
This property should only be changed from its default value for special-purposes such as tabular menus. Regular menus that are connected to a menu bar or context menus should reserve toggle space for consistency.
New in version 2.18.
- Gtk.Menu.props.tearoff_state¶
- Name:
tearoff-state
- Type:
- Default Value:
- Flags:
A boolean that indicates whether the menu is torn-off.
New in version 2.6.
Deprecated since version 3.10.