:right-sidebar: True MultiSelection =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: MultiSelection(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ListModel`, :class:`~gi.repository.Gtk.SectionModel`, :class:`~gi.repository.Gtk.SelectionModel` ``GtkMultiSelection`` is a ``GtkSelectionModel`` that allows selecting multiple elements. Constructors ------------ .. rst-class:: interim-class .. class:: MultiSelection :no-index: .. classmethod:: new(model: ~gi.repository.Gio.ListModel | None = None) -> ~gi.repository.Gtk.MultiSelection Creates a new selection to handle ``model``. :param model: the ``GListModel`` to manage Methods ------- .. rst-class:: interim-class .. class:: MultiSelection :no-index: .. method:: get_model() -> ~gi.repository.Gio.ListModel | None Returns the underlying model of ``self``. .. method:: set_model(model: ~gi.repository.Gio.ListModel | None = None) -> None Sets the model that ``self`` should wrap. If ``model`` is :const:`None`, ``self`` will be empty. :param model: A ``GListModel`` to wrap Properties ---------- .. rst-class:: interim-class .. class:: MultiSelection :no-index: .. attribute:: props.item_type :type: type The type of items. See :obj:`~gi.repository.Gio.ListModel.get_item_type`. .. versionadded:: 4.8 .. attribute:: props.model :type: ~gi.repository.Gio.ListModel The list managed by this selection. .. attribute:: props.n_items :type: int The number of items. See :obj:`~gi.repository.Gio.ListModel.get_n_items`. .. versionadded:: 4.8