Basics
Guides
API Reference
Basics
Guides
API Reference
[84:7] extends: object
A subclass of GtkPopover that implements menu behavior.
GtkPopoverMenu treats
its children like menus and allows switching between them. It can open
submenus as traditional, nested submenus, or in a more touch-friendly sliding
fashion. The property [property@Gtk.PopoverMenu:flags] controls this
appearance. GtkPopoverMenu is meant to be used primarily with menu models,
using [ctor@Gtk.PopoverMenu.new_from_model]. If you need to put other widgets
such as a GtkSpinButton or a GtkSwitch into a popover, you can use
[method@Gtk.PopoverMenu.add_child]. For more dialog-like behavior, use a
plain GtkPopover. ## Menu models The XML format understood by GtkBuilder
for GMenuModel consists of a toplevel <menu> element, which contains one
or more <item> elements. Each <item> element contains <attribute> and
<link> elements with a mandatory name attribute. <link> elements have the
same content model as <menu>. Instead of <link name="submenu"> or <link name="section">, you can use <submenu> or <section> elements. ```xml
PopoverMenu (model = null)
Creates a
GtkPopoverMenuand populates it according to @model. The created buttons are connected to actions found in theGtkApplicationWindowto which the popover belongs - typically by means of being attached to a widget that is contained within theGtkApplicationWindows widget hierarchy. Actions can also be added using [method@Gtk.Widget.insert_action_group] on the menus attach widget or on any of its parent widgets. This function creates menus with sliding submenus. See [ctor@Gtk.PopoverMenu.new_from_model_full] for a way to control this.
model is a GMenuModel.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asPopover ()
Wraps this handle as
Popover.
A Popover object.asAccessible ()
Wraps this handle as
Accessible.
A Accessible object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.asConstraintTarget ()
Wraps this handle as
ConstraintTarget.
A ConstraintTarget object.asNative ()
Wraps this handle as
Native.
A Native object.asShortcutManager ()
Wraps this handle as
ShortcutManager.
A ShortcutManager object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setFlags (string Value)
The flags that @popover uses to create/display a menu from its model. If a model is set and the flags change, contents are rebuilt, so if setting properties individually, set flags before model to avoid a redundant rebuild.
Value is the new property value.None.setMenumodel (object Value)
The model from which the menu is made.
Value is the new property value.None.setVisiblesubmenu (string Value)
The name of the visible submenu.
Value is the new property value.None.add_child (object child, string id)
Adds a custom widget to a generated menu. For this to work, the menu model of @popover must have an item with a
customattribute that matches @id.
child is the GtkWidget to add.id is the ID to insert @child at.get_flags ()
Returns the flags that @popover uses to create/display a menu from its model.
get_menu_model ()
Returns the menu model used to populate the popover.
remove_child (object child)
Removes a widget that has previously been added with [method@Gtk.PopoverMenu.add_child]
child is the GtkWidget to remove.set_flags (string flags)
Sets the flags that @popover uses to create/display a menu from its model. If a model is set and the flags change, contents are rebuilt, so if setting properties individually, set flags before model to avoid a redundant rebuild.
flags is a set of GtkPopoverMenuFlags.None.set_menu_model (object model)
Sets a new menu model on @popover. The existing contents of @popover are removed, and the @popover is populated with new contents according to
model is a GMenuModel.None.[378:14] static extends: object
Generated metadata helpers for PopoverMenu class surfaces.
properties ()
Returns property metadata for
PopoverMenu.
A list.[354:14] static extends: object
Alternate constructors for PopoverMenu. Usage:
PopoverMenuCtors.<name>(...). The primary constructor lives
directly on PopoverMenu.
newFromModelFull (object model, string flags)
Creates a
GtkPopoverMenuand populates it according to @model. The created buttons are connected to actions found in the action groups that are accessible from the parent widget. This includes theGtkApplicationWindowto which the popover belongs. Actions can also be added using [method@Gtk.Widget.insert_action_group] on the parent widget or on any of its parent widgets.
model is a GMenuModel.flags is flags that affect how the menu is created.A new PopoverMenu.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.