Top | ![]() |
![]() |
![]() |
![]() |
GtkPropertySelection is an implementation of the GtkSelectionModel interface that stores the selected state for each item in a property of the item.
The property named by “property” must be writable boolean property of the item type. GtkPropertySelection preserves the selected state of items when they are added to the model, but it does not listen to changes of the property while the item is a part of the model. It assumes that it has *exclusive* access to the property.
The advantage of storing the selected state in item properties is that the state is *persistent* -- when an item is removed and re-added to the model, it will still have the same selection state. In particular, this makes the selection persist across changes of the sort order if the underlying model is a GtkSortListModel.
GListModel * gtk_property_selection_new (GListModel *model
,const char *property
);
Creates a new property selection to handle model
.
property
must be the name of a writable boolean property
of the item type of model
.
Note that GtkPropertySelection does not monitor the property for changes while the item is part of the model, but it does inherit the initial value when an item is added to the model.