Class
Gtk.Filter
Description [src]
class Gtk.Filter : GObject.Object {
parent_instance: GObject
}
A GtkFilter
object describes the filtering to be performed by a
GtkFilterListModel
.
The model will use the filter to determine if it should include items
or not by calling gtk_filter_match()
for each item and only
keeping the ones that the function returns TRUE
for.
Filters may change what items they match through their lifetime. In that
case, they will emit the GtkFilter::changed
signal to notify
that previous filter results are no longer valid and that items should
be checked again via gtk_filter_match()
.
GTK provides various pre-made filter implementations for common filtering operations. These filters often include properties that can be linked to various widgets to easily allow searches.
However, in particular for large lists or complex search methods, it is
also possible to subclass GtkFilter
and provide one’s own filter.
Instance methods
gtk_filter_changed
Emits the GtkFilter::changed
signal to notify all users of the filter that
the filter changed. Users of the filter should then check items again via
gtk_filter_match()
.
gtk_filter_get_strictness
Gets the known strictness of filters
. If the strictness is not known,
GTK_FILTER_MATCH_SOME
is returned.
gtk_filter_match
Checks if the given item
is matched by the filter or not.
Signals
Gtk.Filter::changed
Emitted whenever the filter changed.
Class structure
struct GtkFilterClass {
GObjectClass parent_class;
gboolean (* match) (
GtkFilter* self,
GObject* item
);
GtkFilterMatch (* get_strictness) (
GtkFilter* self
);
void (* _gtk_reserved1) (
void
);
void (* _gtk_reserved2) (
void
);
void (* _gtk_reserved3) (
void
);
void (* _gtk_reserved4) (
void
);
void (* _gtk_reserved5) (
void
);
void (* _gtk_reserved6) (
void
);
void (* _gtk_reserved7) (
void
);
void (* _gtk_reserved8) (
void
);
}
Class members
parent_class |
|
No description available. | |
match |
|
No description available. | |
get_strictness |
|
No description available. | |
_gtk_reserved1 |
|
No description available. | |
_gtk_reserved2 |
|
No description available. | |
_gtk_reserved3 |
|
No description available. | |
_gtk_reserved4 |
|
No description available. | |
_gtk_reserved5 |
|
No description available. | |
_gtk_reserved6 |
|
No description available. | |
_gtk_reserved7 |
|
No description available. | |
_gtk_reserved8 |
|
No description available. |
Virtual methods
Gtk.FilterClass.get_strictness
Gets the known strictness of filters
. If the strictness is not known,
GTK_FILTER_MATCH_SOME
is returned.
Gtk.FilterClass.match
Checks if the given item
is matched by the filter or not.