GtkCustomFilter — Filtering with callbacks
gboolean | (*GtkCustomFilterFunc) () |
GtkCustomFilter * | gtk_custom_filter_new () |
void | gtk_custom_filter_set_filter_func () |
GObject ╰── GtkFilter ╰── GtkCustomFilter
#include <gtk/gtk.h>
GtkCustomFilter is a GtkFilter that uses a callback to determine whether to include an item or not.
gboolean (*GtkCustomFilterFunc) (gpointer item, gpointer user_data);
User function that is called to determine if the item
should be matched. If the filter matches the item, this function must return TRUE
. If the item should be filtered out, FALSE
must be returned.
item | The item to be matched. | [type GObject] |
user_data | user data |
TRUE
to keep the item around
GtkCustomFilter * gtk_custom_filter_new (GtkCustomFilterFunc match_func
,gpointer user_data
,GDestroyNotify user_destroy
);
Creates a new filter using the given match_func
to filter items.
If match_func
is NULL
, the filter matches all items.
If the filter func changes its filtering behavior, gtk_filter_changed()
needs to be called.
match_func | function to filter items. | [nullable] |
user_data | user data to pass to | [nullable] |
user_destroy | destroy notify for |
a new GtkCustomFilter
void gtk_custom_filter_set_filter_func (GtkCustomFilter *self
,GtkCustomFilterFunc match_func
,gpointer user_data
,GDestroyNotify user_destroy
);
Sets (or unsets) the function used for filtering items.
If match_func
is NULL
, the filter matches all items.
If the filter func changes its filtering behavior, gtk_filter_changed()
needs to be called.
If a previous function was set, its user_destroy
will be called now.
self | ||
match_func | function to filter items. | [nullable] |
user_data | user data to pass to | [nullable] |
user_destroy | destroy notify for |
typedef struct _GtkCustomFilter GtkCustomFilter;
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkCustomFilter.html