Trait gtk::prelude::TreeStoreExt[][src]

pub trait TreeStoreExt: 'static {
Show methods fn append(&self, parent: Option<&TreeIter>) -> TreeIter;
fn clear(&self);
fn insert(&self, parent: Option<&TreeIter>, position: i32) -> TreeIter;
fn insert_after(
        &self,
        parent: Option<&TreeIter>,
        sibling: Option<&TreeIter>
    ) -> TreeIter;
fn insert_before(
        &self,
        parent: Option<&TreeIter>,
        sibling: Option<&TreeIter>
    ) -> TreeIter;
fn is_ancestor(&self, iter: &TreeIter, descendant: &TreeIter) -> bool;
fn iter_depth(&self, iter: &TreeIter) -> i32;
fn iter_is_valid(&self, iter: &TreeIter) -> bool;
fn move_after(&self, iter: &TreeIter, position: Option<&TreeIter>);
fn move_before(&self, iter: &TreeIter, position: Option<&TreeIter>);
fn prepend(&self, parent: Option<&TreeIter>) -> TreeIter;
fn remove(&self, iter: &TreeIter) -> bool;
fn swap(&self, a: &TreeIter, b: &TreeIter);
}
Expand description

Trait containing all TreeStore methods.

Implementors

TreeStore

Required methods

Appends a new row to self. If parent is non-None, then it will append the new row after the last child of parent, otherwise it will append a row to the top level. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or TreeStoreExtManual::set_value().

parent

A valid TreeIter, or None

Returns

iter

An unset TreeIter to set to the appended row

Removes all rows from self

Creates a new row at position. If parent is non-None, then the row will be made a child of parent. Otherwise, the row will be created at the toplevel. If position is -1 or is larger than the number of rows at that level, then the new row will be inserted to the end of the list. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or TreeStoreExtManual::set_value().

parent

A valid TreeIter, or None

position

position to insert the new row, or -1 for last

Returns

iter

An unset TreeIter to set to the new row

Inserts a new row after sibling. If sibling is None, then the row will be prepended to parent ’s children. If parent and sibling are None, then the row will be prepended to the toplevel. If both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, parent is optional.

iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or TreeStoreExtManual::set_value().

parent

A valid TreeIter, or None

sibling

A valid TreeIter, or None

Returns

iter

An unset TreeIter to set to the new row

Inserts a new row before sibling. If sibling is None, then the row will be appended to parent ’s children. If parent and sibling are None, then the row will be appended to the toplevel. If both sibling and parent are set, then parent must be the parent of sibling. When sibling is set, parent is optional.

iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or TreeStoreExtManual::set_value().

parent

A valid TreeIter, or None

sibling

A valid TreeIter, or None

Returns

iter

An unset TreeIter to set to the new row

Returns true if iter is an ancestor of descendant. That is, iter is the parent (or grandparent or great-grandparent) of descendant.

iter

A valid TreeIter

descendant

A valid TreeIter

Returns

true, if iter is an ancestor of descendant

Returns the depth of iter. This will be 0 for anything on the root level, 1 for anything down a level, etc.

iter

A valid TreeIter

Returns

The depth of iter

WARNING: This function is slow. Only use it for debugging and/or testing purposes.

Checks if the given iter is a valid iter for this TreeStore.

iter

A TreeIter.

Returns

true if the iter is valid, false if the iter is invalid.

Moves iter in self to the position after position. iter and position should be in the same level. Note that this function only works with unsorted stores. If position is None, iter will be moved to the start of the level.

iter

A TreeIter.

position

A TreeIter.

Moves iter in self to the position before position. iter and position should be in the same level. Note that this function only works with unsorted stores. If position is None, iter will be moved to the end of the level.

iter

A TreeIter.

position

A TreeIter or None.

Prepends a new row to self. If parent is non-None, then it will prepend the new row before the first child of parent, otherwise it will prepend a row to the top level. iter will be changed to point to this new row. The row will be empty after this function is called. To fill in values, you need to call gtk_tree_store_set() or TreeStoreExtManual::set_value().

parent

A valid TreeIter, or None

Returns

iter

An unset TreeIter to set to the prepended row

Removes iter from self. After being removed, iter is set to the next valid row at that level, or invalidated if it previously pointed to the last one.

iter

A valid TreeIter

Returns

true if iter is still valid, false if not.

Swaps a and b in the same level of self. Note that this function only works with unsorted stores.

a

A TreeIter.

b

Another TreeIter.

Implementors