:right-sidebar: True CustomFilter =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: CustomFilter(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Filter`, :class:`~gi.repository.GObject.Object` ``GtkCustomFilter`` determines whether to include items with a callback. Constructors ------------ .. rst-class:: interim-class .. class:: CustomFilter :no-index: .. classmethod:: new(match_func: ~typing.Callable[[...], bool] | None = None, *user_data: ~typing.Any) -> ~gi.repository.Gtk.CustomFilter Creates a new filter using the given ``match_func`` to filter items. If ``match_func`` is :const:`None`, the filter matches all items. If the filter func changes its filtering behavior, :func:`~gi.repository.Gtk.Filter.changed` needs to be called. :param match_func: function to filter items :param user_data: user data to pass to ``match_func`` Methods ------- .. rst-class:: interim-class .. class:: CustomFilter :no-index: .. method:: set_filter_func(match_func: ~typing.Callable[[...], bool] | None = None, *user_data: ~typing.Any) -> None Sets the function used for filtering items. If ``match_func`` is :const:`None`, the filter matches all items. If the filter func changes its filtering behavior, :func:`~gi.repository.Gtk.Filter.changed` needs to be called. If a previous function was set, its ``user_destroy`` will be called now. :param match_func: function to filter items :param user_data: user data to pass to ``match_func``