W Wrapl, The Programming Language

Libraries:Gtk:Gtk:TreeSelection

Types

T

Inherits from:

The T object is a helper object to manage the selection for a Gtk.Gtk.TreeView.T widget. The T object is automatically created when a new Gtk.Gtk.TreeView.T widget is created, and cannot exist independentally of this widget. The primary reason the T objects exists is for cleanliness of code and API. That is, there is no conceptual reason all these functions could not be methods on the Gtk.Gtk.TreeView.T widget instead of a separate function.

The T object is gotten from a Gtk.Gtk.TreeView.T by calling Gtk.Gtk.TreeView.GetSelection. It can be manipulated to check the selection status of the tree, as well as select and deselect individual rows. Selection is done completely view side. As a result, multiple views of the same model can have completely different selections. Additionally, you cannot change the selection of a row on the model that is not currently displayed by the view without expanding its parents first.

One of the important things to remember when monitoring the selection of a view is that the "changed" signal is mostly a hint. That is, it may only emit one signal when a range of rows is selected. Additionally, it may on occasion emit a ::changed signal when nothing has happened (mostly as a result of programmers calling select_row on an already selected row).



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



Methods

:CountSelectedRows(self @ T) : Std.Integer.SmallT

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

selection A T.
Returns The number of rows selected.


:GetMode(self @ T) : Gtk.Gtk.SelectionMode.T

Gets the selection mode for selection. See SetMode.

selection a T
Returns the current selection mode


:GetSelectFunction(self @ T) : Std.Function.T

Returns the current selection function.

selection A T.
Returns The function.


:GetSelected(self @ T, model @ Std.Object.T, iter @ Gtk.Gtk.TreeIter.T) : Std.Symbol.T

Sets iter to the currently selected node if selection is set to Gtk.Gtk.SelectionMode.Single or Gtk.Gtk.SelectionMode.Browse. iter may be NULL if you just want to test if selection has any selected nodes. model is filled with the current model as a convenience. This function will not work if you use selection is Gtk.Gtk.SelectionMode.Multiple.

selection A T.
model A pointer to set to the Gtk.Gtk.TreeModel.T, or NULL. [out][allow-none][transfer none]
iter The Gtk.Gtk.TreeIter.T, or NULL. [out][allow-none]
Returns TRUE, if there is a selected node.


:GetSelectedRows(self @ T, model @ Std.Object.T) : Std.Object.T

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 Gtk.Gtk.TreeRowReference.Ts. To do this, you can use gtk_tree_row_reference_new().

To free the return value, use:

1
2
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (list);


:GetTreeView(self @ T) : Gtk.Gtk.TreeView.T

Returns the tree view associated with selection.

selection A T
Returns A Gtk.Gtk.TreeView.T. [transfer none]


:GetUserData(self @ T) : Std.Address.T

Returns the user data for the selection function.

selection A T.
Returns The user data.


:IterIsSelected(self @ T, iter @ Gtk.Gtk.TreeIter.T) : Std.Symbol.T

Returns TRUE if the row at iter is currently selected.

selection A T
iter A valid Gtk.Gtk.TreeIter.T
Returns TRUE, if iter is selected


:PathIsSelected(self @ T, path @ Gtk.Gtk.TreePath.T) : Std.Symbol.T

Returns TRUE if the row pointed to by path is currently selected. If path does not point to a valid location, FALSE is returned

selection A T.
path A Gtk.Gtk.TreePath.T to check selection on.
Returns TRUE if path is selected.


:SelectAll(self @ T) : Std.Object.T

Selects all the nodes. selection must be set to Gtk.Gtk.SelectionMode.Multiple mode.

selection A T.


:SelectIter(self @ T, iter @ Gtk.Gtk.TreeIter.T) : Std.Object.T

Selects the specified iterator.

selection A T.
iter The Gtk.Gtk.TreeIter.T to be selected.


:SelectPath(self @ T, path @ Gtk.Gtk.TreePath.T) : Std.Object.T

Select the row at path.

selection A T.
path The Gtk.Gtk.TreePath.T to be selected.


:SelectRange(self @ T, start_path @ Gtk.Gtk.TreePath.T, end_path @ Gtk.Gtk.TreePath.T) : Std.Object.T

Selects a range of nodes, determined by start_path and end_path inclusive. selection must be set to Gtk.Gtk.SelectionMode.Multiple mode.

selection A T.
start_path The initial node of the range.
end_path The final node of the range.


:SelectedForeach(self @ T, func @ Std.Function.T, data @ Std.Address.T) : Std.Object.T

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

selection A T.
func The function to call for each selected node. [scope call]
data user data to pass to the function.


:SetMode(self @ T, type @ Gtk.Gtk.SelectionMode.T) : Std.Object.T

Sets the selection mode of the selection. If the previous type was Gtk.Gtk.SelectionMode.Multiple, then the anchor is kept selected, if it was previously selected.

selection A T.
type The selection mode


:SetSelectFunction(self @ T, func @ Std.Function.T, data @ Std.Address.T, destroy @ Std.Function.T) : Std.Object.T

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.

selection A T.
func The selection function.
data The selection function's data.
destroy The destroy function for user data. May be NULL.


:UnselectAll(self @ T) : Std.Object.T

Unselects all the nodes.

selection A T.


:UnselectIter(self @ T, iter @ Gtk.Gtk.TreeIter.T) : Std.Object.T

Unselects the specified iterator.

selection A T.
iter The Gtk.Gtk.TreeIter.T to be unselected.


:UnselectPath(self @ T, path @ Gtk.Gtk.TreePath.T) : Std.Object.T

Unselects the row at path.

selection A T.
path The Gtk.Gtk.TreePath.T to be unselected.


:UnselectRange(self @ T, start_path @ Gtk.Gtk.TreePath.T, end_path @ Gtk.Gtk.TreePath.T) : Std.Object.T

Unselects a range of nodes, determined by start_path and end_path inclusive.

selection A T.
start_path The initial node of the range.
end_path The initial node of the range.