About all my projects
Gnome::Gtk4::PopoverMenuBar

Gnome::Gtk4::PopoverMenuBar

Description

Gnome::Gtk4::PopoverMenuBar presents a horizontal bar of items that pop up popover menus when clicked.

No caption

The only way to create instances of Gnome::Gtk4::PopoverMenuBar is from a Gnome::Gio::MenuModel.

CSS nodes

Gnome::Gtk4::PopoverMenuBar has a single CSS node with name menubar, below which each item has its CSS node, and below that the corresponding popover.

The item whose popover is currently open gets the .active style class.

Accessibility

Gnome::Gtk4::PopoverMenuBar uses the GTK_ACCESSIBLE_ROLE_MENU_BAR role, the menu items use the GTK_ACCESSIBLE_ROLE_MENU_ITEM role and the menus use the GTK_ACCESSIBLE_ROLE_MENU role.

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-from-model

Creates a Gnome::Gtk4::PopoverMenuBar from a Gnome::Gio::MenuModel.

method new-from-model ( N-Object() $model --> Gnome::Gtk4::PopoverMenuBar \)
  • $model; a Gnome::Gio::MenuModel.

Methods

add-child

Adds a custom widget to a generated menubar.

For this to work, the menu model of $bar must have an item with a custom attribute that matches $id.

method add-child ( N-Object() $child, Str $id --> Bool )
  • $child; the Gnome::Gtk4::Widget to add.

  • $id; the ID to insert $child at.

Return value; True if $id was found and the widget added.

get-menu-model

Returns the model from which the contents of $bar are taken.

method get-menu-model (--> N-Object )

Return value; a Gnome::Gio::MenuModel.

remove-child

Removes a widget that has previously been added with .add-child().

method remove-child ( N-Object() $child --> Bool )
  • $child; the Gnome::Gtk4::Widget to remove.

Return value; True if the widget was removed.

set-menu-model

Sets a menu model from which $bar should take its contents.

method set-menu-model ( N-Object() $model )
  • $model; a Gnome::Gio::MenuModel.