:right-sidebar: True CustomSorter =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: CustomSorter(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Sorter`, :class:`~gi.repository.GObject.Object` ``GtkCustomSorter`` is a ``GtkSorter`` implementation that sorts via a callback function. Methods ------- .. rst-class:: interim-class .. class:: CustomSorter :no-index: .. classmethod:: new(sort_func, user_data=None) :param sort_func: :param user_data: .. method:: set_sort_func(sort_func, user_data=None) Sets (or unsets) the function used for sorting items. If ``sort_func`` is :const:`None`, all items are considered equal. If the sort func changes its sorting behavior, :func:`~gi.repository.Gtk.Sorter.changed` needs to be called. If a previous function was set, its ``user_destroy`` will be called now. :param sort_func: function to sort items :param user_data: user data to pass to ``match_func``