CustomFilter#
GtkCustomFilter determines whether to include items with a callback.
Constructors#
- class CustomFilter
- classmethod new(match_func: Callable[[Object, Any], bool] | None = None, user_data: Any = None) CustomFilter#
Creates a new filter using the given
match_functo filter items.If
match_funcisNone, 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[[Object, Any], bool] | None = None, user_data: Any = None) None#
Sets the function used for filtering items.
If
match_funcisNone, 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_destroywill be called now.- Parameters:
match_func – function to filter items
user_data – user data to pass to
match_func