CollectionModel
Object Hierarchy:
Gcr.CollectionModel
Gcr.CollectionModel
Gcr.CollectionModel
GLib.Object
GLib.Object
GLib.Object->Gcr.CollectionModel
Gtk.TreeModel
Gtk.TreeModel
Gtk.TreeModel->Gcr.CollectionModel
Gtk.TreeSortable
Gtk.TreeSortable
Gtk.TreeSortable->Gcr.CollectionModel
Description:
[ CCode ( type_id = "gcr_collection_model_get_type ()" ) ]public class CollectionModel : Object , TreeModel , TreeSortable
Ain implementation of a [iface@Gtk.
TreeModel] which contains a row for each object in a [[email protected] ].
As objects are added or removed from the collection, rows are added and removed from this model.
The row values come from the properties of the objects in the collection. Use [[email protected] ] to create a new collection
model. To have more control over the values use a set of [[email protected] ] structures to define the columns. This can be done with [
[email protected] _full] or [[email protected] _columns].
Each row can have a selected state, which is represented by a boolean column. The selected state can be toggled with
toggle_selected or set with
set_selected_objects and retrieved with [
[email protected] _selected_objects].
To determine which object a row represents and vice versa, use the [[email protected] _for_object] or [
[email protected] _for_iter] functions.
Content:
Properties:
Creation methods:
Methods:
public void change_selected (TreeIter iter, bool selected)
Set whether a given row is toggled selected or not.
public int column_for_selected ()
Get the column identifier for the column that contains the values of
the selected state.
public unowned Collection get_collection ()
Get the collection which this model represents
public List <unowned Object > get_selected_objects ()
Get a list of checked/selected objects.
public bool is_selected (TreeIter iter)
Check whether a given row has been toggled as selected.
public bool iter_for_object (Object object, TreeIter iter)
Set iter
to the row for the given object.
public unowned Object object_for_iter (TreeIter iter)
Get the object that is represented by the given row in the model.
public void set_collection (Collection ? collection)
Set the collection which this model represents
public void set_selected_objects (List <Object > selected)
Set the checked/selected objects.
public void toggle_selected (TreeIter iter)
Toggle the selected state of a given row.
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref
All known members inherited from interface Gtk.TreeModel
@foreach
@get
get_column_type
get_flags
get_iter
get_iter_first
get_iter_from_string
get_n_columns
get_path
get_string_from_iter
get_valist
get_value
iter_children
iter_has_child
iter_n_children
iter_next
iter_nth_child
iter_parent
iter_previous
ref_node
row_changed
row_deleted
row_has_child_toggled
row_inserted
rows_reordered
rows_reordered_with_length
unref_node
All known members inherited from interface Gtk.TreeSortable
get_sort_column_id
has_default_sort_func
set_default_sort_func
set_sort_column_id
set_sort_func
sort_column_changed