Trait gtk::prelude::TreeSelectionExt[][src]

pub trait TreeSelectionExt: 'static {
Show methods fn count_selected_rows(&self) -> i32;
fn mode(&self) -> SelectionMode;
fn selected(&self) -> Option<(TreeModel, TreeIter)>;
fn selected_rows(&self) -> (Vec<TreePath>, TreeModel);
fn tree_view(&self) -> Option<TreeView>;
fn iter_is_selected(&self, iter: &TreeIter) -> bool;
fn path_is_selected(&self, path: &TreePath) -> bool;
fn select_all(&self);
fn select_iter(&self, iter: &TreeIter);
fn select_path(&self, path: &TreePath);
fn select_range(&self, start_path: &TreePath, end_path: &TreePath);
fn selected_foreach<P: FnMut(&TreeModel, &TreePath, &TreeIter)>(
        &self,
        func: P
    );
fn set_mode(&self, type_: SelectionMode);
fn set_select_function(
        &self,
        func: Option<Box_<dyn Fn(&TreeSelection, &TreeModel, &TreePath, bool) -> bool + 'static>>
    );
fn unselect_all(&self);
fn unselect_iter(&self, iter: &TreeIter);
fn unselect_path(&self, path: &TreePath);
fn unselect_range(&self, start_path: &TreePath, end_path: &TreePath);
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_mode_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Trait containing all TreeSelection methods.

Implementors

TreeSelection

Required methods

Returns the number of rows that have been selected in tree.

Returns

The number of rows selected.

Gets the selection mode for self. See set_mode().

Returns

the current selection mode

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.

Returns

TRUE, if there is a selected node.

model

A pointer to set to the TreeModel, or NULL.

iter

The TreeIter, or NULL.

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:

⚠️ The following code is in C ⚠️

g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);

Returns

A GList containing a TreePath for each selected row.

model

A pointer to set to the TreeModel, or None.

Returns the tree view associated with self.

Returns

A TreeView

Returns true if the row at iter is currently selected.

iter

A valid TreeIter

Returns

true, if iter is selected

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.

Selects all the nodes. self must be set to SelectionMode::Multiple mode.

Selects the specified iterator.

iter

The TreeIter to be selected.

Select the row at path.

path

The TreePath to be selected.

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.

Calls a function for each selected node. Note that you cannot modify the tree or selection from within this function. As a result, selected_rows() might be more useful.

func

The function to call for each selected node.

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

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

Unselects all the nodes.

Unselects the specified iterator.

iter

The TreeIter to be unselected.

Unselects the row at path.

path

The TreePath to be unselected.

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.

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.

Implementors