:right-sidebar: True PopoverMenuBar =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: PopoverMenuBar(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` :Constructors: :: PopoverMenuBar(**properties) new_from_model(model:Gio.MenuModel=None) -> Gtk.Widget Constructors ------------ .. rst-class:: interim-class .. class:: PopoverMenuBar :no-index: .. classmethod:: new_from_model(model: ~gi.repository.Gio.MenuModel | None = None) -> ~gi.repository.Gtk.Widget Creates a ``GtkPopoverMenuBar`` from a ``GMenuModel``. :param model: a ``GMenuModel`` Methods ------- .. rst-class:: interim-class .. class:: PopoverMenuBar :no-index: .. method:: add_child(child: ~gi.repository.Gtk.Widget, id: str) -> bool 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``. :param child: the ``GtkWidget`` to add :param id: the ID to insert ``child`` at .. method:: get_menu_model() -> ~gi.repository.Gio.MenuModel | None Returns the model from which the contents of ``bar`` are taken. .. method:: remove_child(child: ~gi.repository.Gtk.Widget) -> bool Removes a widget that has previously been added with :func:`~gi.repository.Gtk.PopoverMenuBar.add_child`. :param child: the ``GtkWidget`` to remove .. method:: set_menu_model(model: ~gi.repository.Gio.MenuModel | None = None) -> None Sets a menu model from which ``bar`` should take its contents. :param model: a ``GMenuModel`` Properties ---------- .. rst-class:: interim-class .. class:: PopoverMenuBar :no-index: .. attribute:: props.menu_model :type: ~gi.repository.Gio.MenuModel The ``GMenuModel`` from which the menu bar is created. The model should only contain submenus as toplevel elements.