Presents a horizontal bar of items that pop up menus when clicked.
<picture> <source srcset="menubar-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkPopoverMenuBar" src="menubar.png"> </picture> The only way to create instances of GtkPopoverMenuBar is from a GMenuModel.
# CSS nodes
menubar âââ item[.active] â â°ââ popover â°ââ item â°ââ popover
GtkPopoverMenuBar 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
GtkPopoverMenuBar uses the [enumGtk.AccessibleRole.menu_bar] role, the menu items use the [enumGtk.AccessibleRole.menu_item] role and the menus use the [enumGtk.AccessibleRole.menu] role.
<group>Menus and Toolbars</group> <gtkada_demo>create_menu.adb</gtkada_demo>
function "+"
(Widget : access Gtk_Popover_Menu_Bar_Record'Class)
return Gtk.Accessible.Gtk_Accessible
function "+"
(Widget : access Gtk_Popover_Menu_Bar_Record'Class)
return Gtk.Buildable.Gtk_Buildable
function "+"
(Widget : access Gtk_Popover_Menu_Bar_Record'Class)
return Gtk.Constraint_Target.Gtk_Constraint_Target
function "-"
(Interf : Gtk.Accessible.Gtk_Accessible)
return Gtk_Popover_Menu_Bar
function "-"
(Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Popover_Menu_Bar
function "-"
(Interf : Gtk.Constraint_Target.Gtk_Constraint_Target)
return Gtk_Popover_Menu_Bar
function Add_Child
(Self : not null access Gtk_Popover_Menu_Bar_Record;
Child : not null access Gtk.Widget.Gtk_Widget_Record'Class;
Id : UTF8_String) return Boolean
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.
the GtkWidget to add
the ID to insert Child at
True if Id was found and the widget added
procedure Announce
(Self : not null access Gtk_Popover_Menu_Bar_Record;
Message : UTF8_String;
Priority : Gtk.Accessible.Gtk_Accessible_Announcement_Priority)
function Get_Accessible_Id
(Self : not null access Gtk_Popover_Menu_Bar_Record)
return UTF8_String
function Get_Accessible_Parent
(Self : not null access Gtk_Popover_Menu_Bar_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Accessible_Role
(Self : not null access Gtk_Popover_Menu_Bar_Record)
return Gtk.Accessible.Gtk_Accessible_Role
function Get_At_Context
(Self : not null access Gtk_Popover_Menu_Bar_Record)
return Gtk.Atcontext.Gtk_Atcontext
function Get_Bounds
(Self : not null access Gtk_Popover_Menu_Bar_Record;
X : out Glib.Gint;
Y : out Glib.Gint;
Width : out Glib.Gint;
Height : out Glib.Gint) return Boolean
function Get_First_Accessible_Child
(Self : not null access Gtk_Popover_Menu_Bar_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Menu_Model
(Self : not null access Gtk_Popover_Menu_Bar_Record)
return Glib.Menu_Model.Gmenu_Model
Returns the model from which the contents of Bar are taken.
a GMenuModel. Has transfer-ownership='none'.
function Get_Next_Accessible_Sibling
(Self : not null access Gtk_Popover_Menu_Bar_Record)
return Gtk.Accessible.Gtk_Accessible
function Get_Platform_State
(Self : not null access Gtk_Popover_Menu_Bar_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State) return Boolean
function Get_Type return Glib.GType
procedure Gtk_New_From_Model
(Self : out Gtk_Popover_Menu_Bar;
Model : access Glib.Menu_Model.Gmenu_Model_Record'Class)
Creates a GtkPopoverMenuBar from a GMenuModel. Initialize_From_Model does nothing if the object was already created with another call to Initialize* or G_New.
a GMenuModel
type Gtk_Popover_Menu_Bar is access all Gtk_Popover_Menu_Bar_Record'Class;
function Gtk_Popover_Menu_Bar_New_From_Model
(Model : access Glib.Menu_Model.Gmenu_Model_Record'Class)
return Gtk_Popover_Menu_Bar
Creates a GtkPopoverMenuBar from a GMenuModel.
a GMenuModel
type Gtk_Popover_Menu_Bar_Record is new Gtk_Widget_Record with null record;
package Implements_Gtk_Accessible is new Glib.Types.Implements
(Gtk.Accessible.Gtk_Accessible, Gtk_Popover_Menu_Bar_Record, Gtk_Popover_Menu_Bar);
package Implements_Gtk_Buildable is new Glib.Types.Implements
(Gtk.Buildable.Gtk_Buildable, Gtk_Popover_Menu_Bar_Record, Gtk_Popover_Menu_Bar);
package Implements_Gtk_Constraint_Target is new Glib.Types.Implements
(Gtk.Constraint_Target.Gtk_Constraint_Target, Gtk_Popover_Menu_Bar_Record, Gtk_Popover_Menu_Bar);
procedure Initialize_From_Model
(Self : not null access Gtk_Popover_Menu_Bar_Record'Class;
Model : access Glib.Menu_Model.Gmenu_Model_Record'Class)
Creates a GtkPopoverMenuBar from a GMenuModel. Initialize_From_Model does nothing if the object was already created with another call to Initialize* or G_New.
a GMenuModel
Menu_Model_Property : constant Glib.Properties.Property_Boxed;
Type: Gio.Menu_Model The GMenuModel from which the menu bar is created.
The model should only contain submenus as toplevel elements.
function Remove_Child
(Self : not null access Gtk_Popover_Menu_Bar_Record;
Child : not null access Gtk.Widget.Gtk_Widget_Record'Class)
return Boolean
Removes a widget that has previously been added with Gtk.Popover_Menu_Bar.Add_Child.
the GtkWidget to remove
True if the widget was removed
procedure Reset_Property
(Self : not null access Gtk_Popover_Menu_Bar_Record;
Property : Gtk.Accessible.Gtk_Accessible_Property)
procedure Reset_Relation
(Self : not null access Gtk_Popover_Menu_Bar_Record;
Relation : Gtk.Accessible.Gtk_Accessible_Relation)
procedure Reset_State
(Self : not null access Gtk_Popover_Menu_Bar_Record;
State : Gtk.Accessible.Gtk_Accessible_State)
procedure Set_Accessible_Parent
(Self : not null access Gtk_Popover_Menu_Bar_Record;
Parent : Gtk.Accessible.Gtk_Accessible;
Next_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Set_Menu_Model
(Self : not null access Gtk_Popover_Menu_Bar_Record;
Model : access Glib.Menu_Model.Gmenu_Model_Record'Class)
Sets a menu model from which Bar should take its contents.
a GMenuModel
procedure Update_Next_Accessible_Sibling
(Self : not null access Gtk_Popover_Menu_Bar_Record;
New_Sibling : Gtk.Accessible.Gtk_Accessible)
procedure Update_Platform_State
(Self : not null access Gtk_Popover_Menu_Bar_Record;
State : Gtk.Accessible.Gtk_Accessible_Platform_State)