Gnome::Gtk4::PopoverMenuBar
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Description
Gnome::Gtk4::PopoverMenuBar presents a horizontal bar of items that pop up popover menus when clicked.
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.
Uml Diagram
=end rakudoc
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Class initialization
new
:native-object
Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object() :$native-object! )
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Methods =end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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
$childat.
Return value; True if $id was found and the widget added.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
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.
=end rakudoc