It derives from <GObject>.
A list model that filters the elements of another model.
It hides some elements from the underlying model according to criteria
given by a <GtkFilter>.
The model can be set up to do incremental filtering, so that filtering
long lists doesn’t block the UI. See filter-list-model:set-incremental for details.
<GtkFilterListModel> passes through
sections from the underlying model.
The filter for this model.
Its value is a <GtkFilter>, or #f.
Set it with (set! (filter-list-model:filter self) value).
If the model should filter items incrementally.
Its value is a boolean.
Set it with (set! (filter-list-model:incremental self) value).
The type of items. See list-model:get-item-type.
Its value is a class, or a GType number.
It is read only.
The model being filtered.
Its value is a <GListModel>, or #f.
Set it with (set! (filter-list-model:model self) value).
The number of items. See list-model:get-n-items.
Its value is an unsigned 32-bit integer.
It is read only.
Number of items not yet filtered.
Its value is an unsigned 32-bit integer.
It is read only.
Monitor the list items for changes. It may impact performance.
Its value is a boolean.
Set it with (set! (filter-list-model:watch-items self) value).
Gets the <GtkFilter> currently set on self.
Passed: a <GtkFilterListModel>.
Returned: a <GtkFilter>, or #f.
The filter currently in use
Returns whether incremental filtering is enabled.
See filter-list-model:set-incremental.
Passed: a <GtkFilterListModel>.
Returned: a boolean.
#t if incremental filtering is enabled
Gets the model currently filtered or #f if none.
Passed: a <GtkFilterListModel>.
Returned: a <GListModel>, or #f.
The model that gets filtered
Returns the number of items that have not been filtered yet.
You can use this value to check if self is busy filtering by comparing the return value to 0 or you can compute the percentage of the filter remaining by dividing the return value by the total number of items in the underlying model:
pending = gtk_filter_list_model_get_pending (self); model = gtk_filter_list_model_get_model (self); percentage = pending / (double) g_list_model_get_n_items (model);
If no filter operation is ongoing - in particular when
filter-list-model:incremental is #f - this
function returns 0.
Passed: a <GtkFilterListModel>.
Returned: an unsigned 32-bit integer.
The number of items not yet filtered
Returns whether watching items is enabled.
See filter-list-model:set-watch-items.
Passed: a <GtkFilterListModel>.
Returned: a boolean.
#t if watching items is enabled
Creates a new <GtkFilterListModel> that
will filter model using the given filter.
Passed, or left out: a <GListModel>, or
#f.
the model to sort
Passed, or left out: a <GtkFilter>, or #f.
filter
Returned: a <GtkFilterListModel>.
a new <GtkFilterListModel>
Sets the filter used to filter items.
Passed: a <GtkFilterListModel>.
Passed, or left out: a <GtkFilter>, or #f.
filter to use
Sets the filter model to do an incremental sort.
When incremental filtering is enabled, the
<GtkFilterListModel> will not run filters
immediately, but will instead queue an idle handler that incrementally
filters the items and adds them to the list. This of course means that
items are not instantly added to the list, but only appear
incrementally.
When your filter blocks the UI while filtering, you might consider turning this on. Depending on your model and filters, this may become interesting around 10,000 to 100,000 items.
By default, incremental filtering is disabled.
See filter-list-model:get-pending for progress information
about an ongoing incremental filtering operation.
Passed: a <GtkFilterListModel>.
Passed: a boolean.
#t to enable incremental filtering
Sets the model to be filtered.
Note that GTK makes no effort to ensure that model conforms to the item type of self. It assumes that the caller knows what they are doing and have set up an appropriate filter to ensure that item types match.
Passed: a <GtkFilterListModel>.
Passed, or left out: a <GListModel>, or
#f.
The model to be filtered
Sets the filter model to monitor properties of its items.
This allows implementations of <GtkFilter> that
support expression watching to react to property changes. This property
has no effect if the current filter doesn’t support watching items.
By default, watching items is disabled.
Passed: a <GtkFilterListModel>.
Passed: a boolean.
#t to watch items for property changes