1.207 <GtkTreeListModel>

Class: <GtkTreeListModel>

It derives from <GObject>.

A list model that can create child models on demand.

Properties

Property: tree-list-model:autoexpand self

If all rows should be expanded by default.

Its value is a boolean.

Set it with (set! (tree-list-model:autoexpand self) value).

Property: tree-list-model:item-type self

The type of items. See list-model:get-item-type.

Its value is a class, or a GType number.

It is read only.

Property: tree-list-model:model self

The root model displayed.

Its value is a <GListModel>, or #f.

It is read only.

Property: tree-list-model:n-items self

The number of items. See list-model:get-n-items.

Its value is an unsigned 32-bit integer.

It is read only.

Property: tree-list-model:passthrough self

Gets whether the model is in passthrough mode.

If #f, the <GListModel> functions for this object return custom <GtkTreeListRow> objects. If #t, the values of the child models are pass through unmodified.

Its value is a boolean.

It can only be set when the object is made, with #:passthrough.

Procedures

Method: tree-list-model:get-autoexpand? self ⇒ %return
Method: get-autoexpand? self ⇒ %return

Gets whether the model is set to automatically expand new rows that get added.

This can be either rows added by changes to the underlying models or via tree-list-row:set-expanded.

self

Passed: a <GtkTreeListModel>.

a <GtkTreeListModel>

%return

Returned: a boolean.

#t if the model is set to autoexpand

Method: tree-list-model:get-child-row self position ⇒ %return
Method: get-child-row self position ⇒ %return

Gets the row item corresponding to the child at index position for self’s root model.

If position is greater than the number of children in the root model, #f is returned.

Do not confuse this function with tree-list-model:get-row.

self

Passed: a <GtkTreeListModel>.

a <GtkTreeListModel>

position

Passed: an unsigned 32-bit integer.

position of the child to get

%return

Returned: a <GtkTreeListRow>, or #f.

the child in position

Method: tree-list-model:get-model self ⇒ %return
Method: get-model self ⇒ %return

Gets the root model that self was created with.

self

Passed: a <GtkTreeListModel>.

a <GtkTreeListModel>

%return

Returned: a <GListModel>.

the root model

Method: tree-list-model:get-passthrough? self ⇒ %return
Method: get-passthrough? self ⇒ %return

Gets whether the model is passing through original row items.

If this function returns #f, the <GListModel> functions for self return custom <GtkTreeListRow> objects. You need to call tree-list-row:get-item on these objects to get the original item.

If #t, the values of the child models are passed through in their original state. You then need to call tree-list-model:get-row to get the custom <GtkTreeListRow>s.

self

Passed: a <GtkTreeListModel>.

a <GtkTreeListModel>

%return

Returned: a boolean.

#t if the model is passing through original row items

Method: tree-list-model:get-row self position ⇒ %return
Method: get-row self position ⇒ %return

Gets the row object for the given row.

If position is greater than the number of items in self, #f is returned.

The row object can be used to expand and collapse rows as well as to inspect its position in the tree. See its documentation for details.

This row object is persistent and will refer to the current item as long as the row is present in self, independent of other rows being added or removed.

If self is set to not be passthrough, this function is equivalent to calling list-model:get-item.

Do not confuse this function with tree-list-model:get-child-row.

self

Passed: a <GtkTreeListModel>.

a <GtkTreeListModel>

position

Passed: an unsigned 32-bit integer.

the position of the row to fetch

%return

Returned: a <GtkTreeListRow>, or #f.

The row item

Procedure: tree-list-model:new root passthrough autoexpand create-func ⇒ %return

Creates a new empty <GtkTreeListModel> displaying root with all rows collapsed.

root

Passed: a <GListModel>.

The <GListModel> to use as root

passthrough

Passed: a boolean.

#t to pass through items from the models

autoexpand

Passed: a boolean.

#t to set the autoexpand property and expand the root model

create-func

Passed: a procedure.

function to call to create the <GListModel> for the children of an item

See GtkTreeListModelCreateModelFunc for how it is called.

%return

Returned: a <GtkTreeListModel>.

a newly created <GtkTreeListModel>.

user-data

Not passed: guile-gi supplies it.

Data to pass to create-func

user-destroy

Not passed: guile-gi supplies it.

Function to call to free user-data

See GDestroyNotify for how it is called.

Method: tree-list-model:set-autoexpand self autoexpand
Method: set-autoexpand self autoexpand

Sets whether the model should autoexpand.

If set to #t, the model will recursively expand all rows that get added to the model. This can be either rows added by changes to the underlying models or via tree-list-row:set-expanded.

self

Passed: a <GtkTreeListModel>.

a <GtkTreeListModel>

autoexpand

Passed: a boolean.

#t to make the model autoexpand its rows