CustomFilter#
GtkCustomFilter
determines whether to include items with a callback.
Constructors#
- class CustomFilter
- classmethod new(match_func: Callable[[...], bool] | None = None, *user_data: Any) CustomFilter #
Creates a new filter using the given
match_func
to filter items.If
match_func
isNone
, the filter matches all items.If the filter func changes its filtering behavior,
changed()
needs to be called.- Parameters:
match_func – function to filter items
user_data – user data to pass to
match_func
Methods#
- class CustomFilter
- set_filter_func(match_func: Callable[[...], bool] | None = None, *user_data: Any) None #
Sets the function used for filtering items.
If
match_func
isNone
, the filter matches all items.If the filter func changes its filtering behavior,
changed()
needs to be called.If a previous function was set, its
user_destroy
will be called now.- Parameters:
match_func – function to filter items
user_data – user data to pass to
match_func