:right-sidebar: True TreeListRowSorter =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: TreeListRowSorter(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Sorter`, :class:`~gi.repository.GObject.Object` ``GtkTreeListRowSorter`` is a special-purpose sorter that will apply a given sorter to the levels in a tree. Here is an example for setting up a column view with a tree model and a ``GtkTreeListSorter``: .. code-block:: :dedent: column_sorter = gtk_column_view_get_sorter (view); sorter = gtk_tree_list_row_sorter_new (g_object_ref (column_sorter)); sort_model = gtk_sort_list_model_new (tree_model, sorter); selection = gtk_single_selection_new (sort_model); gtk_column_view_set_model (view, G_LIST_MODEL (selection)); Constructors ------------ .. rst-class:: interim-class .. class:: TreeListRowSorter :no-index: .. classmethod:: new(sorter: ~gi.repository.Gtk.Sorter | None = None) -> ~gi.repository.Gtk.TreeListRowSorter Create a special-purpose sorter that applies the sorting of ``sorter`` to the levels of a ``GtkTreeListModel``. Note that this sorter relies on :obj:`~gi.repository.Gtk.TreeListModel.props.passthrough` being :const:`False` as it can only sort :obj:`~gi.repository.Gtk.TreeListRow`'s. :param sorter: a ``GtkSorter`` Methods ------- .. rst-class:: interim-class .. class:: TreeListRowSorter :no-index: .. method:: get_sorter() -> ~gi.repository.Gtk.Sorter | None Returns the sorter used by ``self``. .. method:: set_sorter(sorter: ~gi.repository.Gtk.Sorter | None = None) -> None Sets the sorter to use for items with the same parent. This sorter will be passed the :obj:`~gi.repository.Gtk.TreeListRow.props.item` of the tree list rows passed to ``self``. :param sorter: The sorter to use Properties ---------- .. rst-class:: interim-class .. class:: TreeListRowSorter :no-index: .. attribute:: props.sorter :type: ~gi.repository.Gtk.Sorter The underlying sorter