Skip to content

Gtk.CustomFilter

class — extends Filter

Determines whether to include items with a callback.

Constructors

new

@classmethod
def new(cls, match_func: CustomFilterFunc | None = ...) -> CustomFilter

Creates a new filter using the given function to filter items.

If match_func is NULL, the filter matches all items.

If the filter func changes its filtering behavior, Filter.changed needs to be called.

Parameters:

  • match_func — function to filter items

Methods

set_filter_func

def set_filter_func(self, match_func: CustomFilterFunc | None = ...) -> None

Sets the function used for filtering items.

If match_func is NULL, the filter matches all items.

If the filter func changes its filtering behavior, Filter.changed needs to be called.

If a previous function was set, its user_destroy will be called.

Parameters:

  • match_func — function to filter items