Skip to main content

TreeModelExt

Trait TreeModelExt 

Source
pub trait TreeModelExt: IsA<TreeModel> + 'static {
Show 22 methods // Provided methods fn foreach<P: FnMut(&TreeModel, &TreePath, &TreeIter) -> bool>( &self, func: P, ) { ... } fn column_type(&self, index_: i32) -> Type { ... } fn flags(&self) -> TreeModelFlags { ... } fn iter(&self, path: &TreePath) -> Option<TreeIter> { ... } fn iter_first(&self) -> Option<TreeIter> { ... } fn iter_from_string(&self, path_string: &str) -> Option<TreeIter> { ... } fn n_columns(&self) -> i32 { ... } fn path(&self, iter: &TreeIter) -> TreePath { ... } fn string_from_iter(&self, iter: &TreeIter) -> Option<GString> { ... } fn iter_children(&self, parent: Option<&TreeIter>) -> Option<TreeIter> { ... } fn iter_has_child(&self, iter: &TreeIter) -> bool { ... } fn iter_n_children(&self, iter: Option<&TreeIter>) -> i32 { ... } fn iter_nth_child( &self, parent: Option<&TreeIter>, n: i32, ) -> Option<TreeIter> { ... } fn iter_parent(&self, child: &TreeIter) -> Option<TreeIter> { ... } fn row_changed(&self, path: &TreePath, iter: &TreeIter) { ... } fn row_deleted(&self, path: &TreePath) { ... } fn row_has_child_toggled(&self, path: &TreePath, iter: &TreeIter) { ... } fn row_inserted(&self, path: &TreePath, iter: &TreeIter) { ... } fn connect_row_changed<F: Fn(&Self, &TreePath, &TreeIter) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_row_deleted<F: Fn(&Self, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_row_has_child_toggled<F: Fn(&Self, &TreePath, &TreeIter) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_row_inserted<F: Fn(&Self, &TreePath, &TreeIter) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
๐Ÿ‘ŽDeprecated:

Since 4.10

Expand description

Trait containing all TreeModel methods.

ยงImplementors

ListStore, TreeModelFilter, TreeModelSort, TreeModel, TreeSortable, TreeStore

Provided Methodsยง

Source

fn foreach<P: FnMut(&TreeModel, &TreePath, &TreeIter) -> bool>(&self, func: P)

๐Ÿ‘ŽDeprecated:

Since 4.10

Calls @func on each node in model in a depth-first fashion.

If @func returns true, then the tree ceases to be walked, and gtk_tree_model_foreach() returns.

ยงDeprecated since 4.10
ยงfunc

a function to be called on each row

Source

fn column_type(&self, index_: i32) -> Type

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns the type of the column.

ยงDeprecated since 4.10
ยงindex_

the column index

ยงReturns

the type of the column

Source

fn flags(&self) -> TreeModelFlags

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns a set of flags supported by this interface.

The flags are a bitwise combination of TreeModelFlags. The flags supported should not change during the lifetime of the @self.

ยงDeprecated since 4.10
ยงReturns

the flags supported by this interface

Source

fn iter(&self, path: &TreePath) -> Option<TreeIter>

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets @iter to a valid iterator pointing to @path.

If @path does not exist, @iter is set to an invalid iterator and false is returned.

ยงDeprecated since 4.10
ยงpath

the TreePath

ยงReturns

true, if @iter was set

ยงiter

the uninitialized TreeIter

Source

fn iter_first(&self) -> Option<TreeIter>

๐Ÿ‘ŽDeprecated:

Since 4.10

Initializes @iter with the first iterator in the tree (the one at the path โ€œ0โ€).

Returns false if the tree is empty, true otherwise.

ยงDeprecated since 4.10
ยงReturns

true, if @iter was set

ยงiter

the uninitialized TreeIter

Source

fn iter_from_string(&self, path_string: &str) -> Option<TreeIter>

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets @iter to a valid iterator pointing to @path_string, if it exists.

Otherwise, @iter is left invalid and false is returned.

ยงDeprecated since 4.10
ยงpath_string

a string representation of a TreePath

ยงReturns

true, if @iter was set

ยงiter

an uninitialized TreeIter

Source

fn n_columns(&self) -> i32

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns the number of columns supported by @self.

ยงDeprecated since 4.10
ยงReturns

the number of columns

Source

fn path(&self, iter: &TreeIter) -> TreePath

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns a newly-created TreePath referenced by @iter.

This path should be freed with gtk_tree_path_free().

ยงDeprecated since 4.10
ยงiter

the TreeIter

ยงReturns

a newly-created TreePath

Source

fn string_from_iter(&self, iter: &TreeIter) -> Option<GString>

๐Ÿ‘ŽDeprecated:

Since 4.10

Generates a string representation of the iter.

This string is a โ€œ:โ€ separated list of numbers. For example, โ€œ4:10:0:3โ€ would be an acceptable return value for this string.

ยงDeprecated since 4.10
ยงiter

a TreeIter

ยงReturns

a newly-allocated string

Source

fn iter_children(&self, parent: Option<&TreeIter>) -> Option<TreeIter>

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets @iter to point to the first child of @parent.

If @parent has no children, false is returned and @iter is set to be invalid. @parent will remain a valid node after this function has been called.

If @parent is None returns the first node, equivalent to gtk_tree_model_get_iter_first (tree_model, iter);

ยงDeprecated since 4.10
ยงparent

the TreeIter

ยงReturns

true, if @iter has been set to the first child

ยงiter

the new TreeIter to be set to the child

Source

fn iter_has_child(&self, iter: &TreeIter) -> bool

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns true if @iter has children, false otherwise.

ยงDeprecated since 4.10
ยงiter

the TreeIter to test for children

ยงReturns

true if @iter has children

Source

fn iter_n_children(&self, iter: Option<&TreeIter>) -> i32

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns the number of children that @iter has.

As a special case, if @iter is None, then the number of toplevel nodes is returned.

ยงDeprecated since 4.10
ยงiter

the TreeIter

ยงReturns

the number of children of @iter

Source

fn iter_nth_child(&self, parent: Option<&TreeIter>, n: i32) -> Option<TreeIter>

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets @iter to be the child of @parent, using the given index.

The first index is 0. If @n is too big, or @parent has no children, @iter is set to an invalid iterator and false is returned. @parent will remain a valid node after this function has been called. As a special case, if @parent is None, then the @n-th root node is set.

ยงDeprecated since 4.10
ยงparent

the TreeIter to get the child from

ยงn

the index of the desired child

ยงReturns

true, if @parent has an @n-th child

ยงiter

the TreeIter to set to the nth child

Source

fn iter_parent(&self, child: &TreeIter) -> Option<TreeIter>

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets @iter to be the parent of @child.

If @child is at the toplevel, and doesnโ€™t have a parent, then @iter is set to an invalid iterator and false is returned. @child will remain a valid node after this function has been called.

@iter will be initialized before the lookup is performed, so @child and @iter cannot point to the same memory location.

ยงDeprecated since 4.10
ยงchild

the TreeIter

ยงReturns

true, if @iter is set to the parent of @child

ยงiter

the new TreeIter to set to the parent

Source

fn row_changed(&self, path: &TreePath, iter: &TreeIter)

๐Ÿ‘ŽDeprecated:

Since 4.10

Emits the ::row-changed signal on @self.

See row-changed.

ยงDeprecated since 4.10
ยงpath

a TreePath pointing to the changed row

ยงiter

a valid TreeIter pointing to the changed row

Source

fn row_deleted(&self, path: &TreePath)

๐Ÿ‘ŽDeprecated:

Since 4.10

Emits the ::row-deleted signal on @self.

See row-deleted.

This should be called by models after a row has been removed. The location pointed to by @path should be the location that the row previously was at. It may not be a valid location anymore.

Nodes that are deleted are not unreffed, this means that any outstanding references on the deleted node should not be released.

ยงDeprecated since 4.10
ยงpath

a TreePath pointing to the previous location of the deleted row

Source

fn row_has_child_toggled(&self, path: &TreePath, iter: &TreeIter)

๐Ÿ‘ŽDeprecated:

Since 4.10

Emits the ::row-has-child-toggled signal on @self.

See row-has-child-toggled.

This should be called by models after the child state of a node changes.

ยงDeprecated since 4.10
ยงpath

a TreePath pointing to the changed row

ยงiter

a valid TreeIter pointing to the changed row

Source

fn row_inserted(&self, path: &TreePath, iter: &TreeIter)

๐Ÿ‘ŽDeprecated:

Since 4.10

Emits the ::row-inserted signal on @self.

See row-inserted.

ยงDeprecated since 4.10
ยงpath

a TreePath pointing to the inserted row

ยงiter

a valid TreeIter pointing to the inserted row

Source

fn connect_row_changed<F: Fn(&Self, &TreePath, &TreeIter) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

This signal is emitted when a row in the model has changed.

ยงpath

a TreePath identifying the changed row

ยงiter

a valid TreeIter pointing to the changed row

Source

fn connect_row_deleted<F: Fn(&Self, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

This signal is emitted when a row has been deleted.

Note that no iterator is passed to the signal handler, since the row is already deleted.

This should be called by models after a row has been removed. The location pointed to by @path should be the location that the row previously was at. It may not be a valid location anymore.

ยงpath

a TreePath identifying the row

Source

fn connect_row_has_child_toggled<F: Fn(&Self, &TreePath, &TreeIter) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

This signal is emitted when a row has gotten the first child row or lost its last child row.

ยงpath

a TreePath identifying the row

ยงiter

a valid TreeIter pointing to the row

Source

fn connect_row_inserted<F: Fn(&Self, &TreePath, &TreeIter) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

This signal is emitted when a new row has been inserted in the model.

Note that the row may still be empty at this point, since it is a common pattern to first insert an empty row, and then fill it with the desired values.

ยงpath

a TreePath identifying the new row

ยงiter

a valid TreeIter pointing to the new row

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementorsยง