:right-sidebar: True BuilderListItemFactory =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: BuilderListItemFactory(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.ListItemFactory`, :class:`~gi.repository.GObject.Object` ``GtkBuilderListItemFactory`` is a ``GtkListItemFactory`` that creates widgets by instantiating ``GtkBuilder`` UI templates. The templates must be extending ``GtkListItem``, and typically use ``GtkExpression``'s to obtain data from the items in the model. Example: .. code-block:: :dedent: Constructors ------------ .. rst-class:: interim-class .. class:: BuilderListItemFactory :no-index: .. classmethod:: new_from_bytes(scope: ~gi.repository.Gtk.BuilderScope | None, bytes: ~gi.repository.GLib.Bytes) -> ~gi.repository.Gtk.ListItemFactory Creates a new ``GtkBuilderListItemFactory`` that instantiates widgets using ``bytes`` as the data to pass to ``GtkBuilder``. :param scope: A scope to use when instantiating :param bytes: the ``GBytes`` containing the ui file to instantiate .. classmethod:: new_from_resource(scope: ~gi.repository.Gtk.BuilderScope | None, resource_path: str) -> ~gi.repository.Gtk.ListItemFactory Creates a new ``GtkBuilderListItemFactory`` that instantiates widgets using data read from the given ``resource_path`` to pass to ``GtkBuilder``. :param scope: A scope to use when instantiating :param resource_path: valid path to a resource that contains the data Methods ------- .. rst-class:: interim-class .. class:: BuilderListItemFactory :no-index: .. method:: get_bytes() -> ~gi.repository.GLib.Bytes Gets the data used as the ``GtkBuilder`` UI template for constructing listitems. .. method:: get_resource() -> str | None If the data references a resource, gets the path of that resource. .. method:: get_scope() -> ~gi.repository.Gtk.BuilderScope | None Gets the scope used when constructing listitems. Properties ---------- .. rst-class:: interim-class .. class:: BuilderListItemFactory :no-index: .. attribute:: props.bytes :type: ~gi.repository.GLib.Bytes ``GBytes`` containing the UI definition. .. attribute:: props.resource :type: str Path of the resource containing the UI definition. .. attribute:: props.scope :type: ~gi.repository.Gtk.BuilderScope ``GtkBuilderScope`` to use when instantiating listitems