[−][src]Trait gtk::TreeStoreExt
Required methods
fn append(&self, parent: Option<&TreeIter>) -> TreeIter
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
TreeStoreExt::set
or TreeStore::set_value
.
iter
An unset TreeIter
to set to the appended row
parent
A valid TreeIter
, or None
fn clear(&self)
Removes all rows from self
fn insert(&self, parent: Option<&TreeIter>, position: i32) -> TreeIter
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 TreeStoreExt::set
or
TreeStore::set_value
.
iter
An unset TreeIter
to set to the new row
parent
A valid TreeIter
, or None
position
position to insert the new row, or -1 for last
fn insert_after(
&self,
parent: Option<&TreeIter>,
sibling: Option<&TreeIter>
) -> TreeIter
&self,
parent: Option<&TreeIter>,
sibling: Option<&TreeIter>
) -> TreeIter
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
TreeStoreExt::set
or TreeStore::set_value
.
iter
An unset TreeIter
to set to the new row
parent
A valid TreeIter
, or None
sibling
A valid TreeIter
, or None
fn insert_before(
&self,
parent: Option<&TreeIter>,
sibling: Option<&TreeIter>
) -> TreeIter
&self,
parent: Option<&TreeIter>,
sibling: Option<&TreeIter>
) -> TreeIter
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
TreeStoreExt::set
or TreeStore::set_value
.
iter
An unset TreeIter
to set to the new row
parent
A valid TreeIter
, or None
sibling
A valid TreeIter
, or None
fn is_ancestor(&self, iter: &TreeIter, descendant: &TreeIter) -> bool
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
fn iter_depth(&self, iter: &TreeIter) -> i32
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
fn iter_is_valid(&self, iter: &TreeIter) -> bool
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.
fn move_after(&self, iter: &TreeIter, position: Option<&TreeIter>)
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
.
fn move_before(&self, iter: &TreeIter, position: Option<&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
.
fn prepend(&self, parent: Option<&TreeIter>) -> TreeIter
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 TreeStoreExt::set
or TreeStore::set_value
.
iter
An unset TreeIter
to set to the prepended row
parent
A valid TreeIter
, or None
fn remove(&self, iter: &TreeIter) -> bool
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.
fn swap(&self, a: &TreeIter, b: &TreeIter)
Implementors
impl<O: IsA<TreeStore>> TreeStoreExt for O
[src]
fn append(&self, parent: Option<&TreeIter>) -> TreeIter
[src]
fn clear(&self)
[src]
fn insert(&self, parent: Option<&TreeIter>, position: i32) -> TreeIter
[src]
fn insert_after(
&self,
parent: Option<&TreeIter>,
sibling: Option<&TreeIter>
) -> TreeIter
[src]
&self,
parent: Option<&TreeIter>,
sibling: Option<&TreeIter>
) -> TreeIter
fn insert_before(
&self,
parent: Option<&TreeIter>,
sibling: Option<&TreeIter>
) -> TreeIter
[src]
&self,
parent: Option<&TreeIter>,
sibling: Option<&TreeIter>
) -> TreeIter