[−][src]Trait gtk::TreeSelectionExt
Required methods
fn count_selected_rows(&self) -> i32
fn get_mode(&self) -> SelectionMode
Gets the selection mode for self
. See
TreeSelectionExt::set_mode
.
Returns
the current selection mode
fn get_selected(&self) -> Option<(TreeModel, TreeIter)>
Sets iter
to the currently selected node if self
is set to
SelectionMode::Single
or SelectionMode::Browse
. iter
may be NULL if you
just want to test if self
has any selected nodes. model
is filled
with the current model as a convenience. This function will not work if you
use self
is SelectionMode::Multiple
.
model
A pointer to set to the TreeModel
, or NULL.
iter
The TreeIter
, or NULL.
Returns
TRUE, if there is a selected node.
fn get_selected_rows(&self) -> (Vec<TreePath>, TreeModel)
Creates a list of path of all selected rows. Additionally, if you are
planning on modifying the model after calling this function, you may
want to convert the returned list into a list of GtkTreeRowReferences
.
To do this, you can use TreeRowReference::new
.
To free the return value, use:
g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
model
A pointer to set to the TreeModel
, or None
.
Returns
A glib::List
containing a TreePath
for each selected row.
fn get_tree_view(&self) -> Option<TreeView>
fn iter_is_selected(&self, iter: &TreeIter) -> bool
Returns true
if the row at iter
is currently selected.
iter
A valid TreeIter
Returns
true
, if iter
is selected
fn path_is_selected(&self, path: &TreePath) -> bool
Returns true
if the row pointed to by path
is currently selected. If path
does not point to a valid location, false
is returned
path
A TreePath
to check selection on.
Returns
true
if path
is selected.
fn select_all(&self)
Selects all the nodes. self
must be set to SelectionMode::Multiple
mode.
fn select_iter(&self, iter: &TreeIter)
fn select_path(&self, path: &TreePath)
fn select_range(&self, start_path: &TreePath, end_path: &TreePath)
Selects a range of nodes, determined by start_path
and end_path
inclusive.
self
must be set to SelectionMode::Multiple
mode.
start_path
The initial node of the range.
end_path
The final node of the range.
fn selected_foreach<P: FnMut(&TreeModel, &TreePath, &TreeIter)>(&self, func: P)
Calls a function for each selected node. Note that you cannot modify
the tree or selection from within this function. As a result,
TreeSelectionExt::get_selected_rows
might be more useful.
func
The function to call for each selected node.
data
user data to pass to the function.
fn set_mode(&self, type_: SelectionMode)
Sets the selection mode of the self
. If the previous type was
SelectionMode::Multiple
, then the anchor is kept selected, if it was
previously selected.
type_
The selection mode
fn set_select_function(
&self,
func: Option<Box_<dyn Fn(&TreeSelection, &TreeModel, &TreePath, bool) -> bool + 'static>>
)
&self,
func: Option<Box_<dyn Fn(&TreeSelection, &TreeModel, &TreePath, bool) -> bool + 'static>>
)
Sets the selection function.
If set, this function is called before any node is selected or unselected,
giving some control over which nodes are selected. The select function
should return true
if the state of the node may be toggled, and false
if the state of the node should be left unchanged.
func
The selection function. May be None
data
The selection function’s data. May be None
destroy
The destroy function for user data. May be None
fn unselect_all(&self)
Unselects all the nodes.
fn unselect_iter(&self, iter: &TreeIter)
fn unselect_path(&self, path: &TreePath)
fn unselect_range(&self, start_path: &TreePath, end_path: &TreePath)
Unselects a range of nodes, determined by start_path
and end_path
inclusive.
start_path
The initial node of the range.
end_path
The initial node of the range.
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted whenever the selection has (possibly) changed. Please note that this signal is mostly a hint. It may only be emitted once when a range of rows are selected, and it may occasionally be emitted when nothing has happened.
fn connect_property_mode_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<TreeSelection>> TreeSelectionExt for O
[src]
fn count_selected_rows(&self) -> i32
[src]
fn get_mode(&self) -> SelectionMode
[src]
fn get_selected(&self) -> Option<(TreeModel, TreeIter)>
[src]
fn get_selected_rows(&self) -> (Vec<TreePath>, TreeModel)
[src]
fn get_tree_view(&self) -> Option<TreeView>
[src]
fn iter_is_selected(&self, iter: &TreeIter) -> bool
[src]
fn path_is_selected(&self, path: &TreePath) -> bool
[src]
fn select_all(&self)
[src]
fn select_iter(&self, iter: &TreeIter)
[src]
fn select_path(&self, path: &TreePath)
[src]
fn select_range(&self, start_path: &TreePath, end_path: &TreePath)
[src]
fn selected_foreach<P: FnMut(&TreeModel, &TreePath, &TreeIter)>(&self, func: P)
[src]
fn set_mode(&self, type_: SelectionMode)
[src]
fn set_select_function(
&self,
func: Option<Box_<dyn Fn(&TreeSelection, &TreeModel, &TreePath, bool) -> bool + 'static>>
)
[src]
&self,
func: Option<Box_<dyn Fn(&TreeSelection, &TreeModel, &TreePath, bool) -> bool + 'static>>
)
fn unselect_all(&self)
[src]
fn unselect_iter(&self, iter: &TreeIter)
[src]
fn unselect_path(&self, path: &TreePath)
[src]
fn unselect_range(&self, start_path: &TreePath, end_path: &TreePath)
[src]
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
[src]
fn connect_property_mode_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId