Package: gtk
Class gtk:popover-menu
Superclassesgtk:popover, gtk:widget, gobject:initially-unowned, gtk:accessible, gtk:buildable, gtk:constraint-target, gtk:native, gtk:shortcut-manager, gobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gtk:popover-menu class is a subclass of the gtk:popover
class that 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 gtk:popover-menu widget is meant to be used primarily with menu models, using the gtk:popover-menu-new-from-model function. If you need to put other widgets such as gtk:spin-button or gtk:switch widgets into a popover, use a plain gtk:popover widget. Menu modelsThe XML format understood by the gtk:builder object for the g:menu-model object 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.<menu id='app-menu'> <section> <item> <attribute name='label' translatable='yes'>_New Window</attribute> <attribute name='action'>app.new</attribute> </item> <item> <attribute name='label' translatable='yes'>_About Sunny</attribute> <attribute name='action'>app.about</attribute> </item> <item> <attribute name='label' translatable='yes'>_Quit</attribute> <attribute name='action'>app.quit</attribute> </item> </section> </menu>Attribute values can be translated using GNU gettext, like other GtkBuilder content. <attribute> elements can be marked for translation with a translatable="yes" attribute. It is also possible to specify message context and translator comments, using the context and comments attributes. To make use of this, the GtkBuilder must have been given the GNU gettext domain to use. The following attributes are used when constructing menu items:
CSS nodesAccessibility | Returned bySlot Access FunctionsInherited Slot Access FunctionsSee also |
2024-10-26