Class: Gtk::TreeSelection

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#count_selected_rowsInteger

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

Returns:

  • (Integer)

    The number of rows selected.

#get_selected(model, iter) ⇒ TrueClass

Sets iter to the currently selected node if selection is set to #GTK_SELECTION_SINGLE or #GTK_SELECTION_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_SELECTION_MULTIPLE.

Parameters:

  • model (Gtk::TreeModel)

    A pointer to set to the Gtk::TreeModel, or NULL.

  • iter (Gtk::TreeIter)

    The Gtk::TreeIter, or NULL.

Returns:

  • (TrueClass)

    TRUE, if there is a selected node.

#get_selected_rows(model) ⇒ GLib::List

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::TreeRowReferences. To do this, you can use gtk_tree_row_reference_new().

To free the return value, use:

g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);

Parameters:

  • model (Gtk::TreeModel)

    A pointer to set to the Gtk::TreeModel, or nil.

Returns:

  • (GLib::List)

    A #GList containing a Gtk::TreePath for each selected row.

#iter_is_selected(iter) ⇒ TrueClass

Returns true if the row at iter is currently selected.

Parameters:

  • iter (Gtk::TreeIter)

    A valid Gtk::TreeIter

Returns:

  • (TrueClass)

    true, if iter is selected

#modeGtk::SelectionMode

Selection mode. See gtk_tree_selection_set_mode() for more information on this property.

Returns:

#mode=(mode) ⇒ Gtk::SelectionMode

Selection mode. See gtk_tree_selection_set_mode() for more information on this property.

Parameters:

Returns:

#path_is_selected(path) ⇒ TrueClass

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

Parameters:

  • path (Gtk::TreePath)

    A Gtk::TreePath to check selection on.

Returns:

  • (TrueClass)

    true if path is selected.

#select_allnil

Selects all the nodes. selection must be set to #GTK_SELECTION_MULTIPLE mode.

Returns:

  • (nil)

#select_functionGtk::TreeSelectionFunc

Returns the current selection function.

Returns:

  • (Gtk::TreeSelectionFunc)

    The function.

#select_iter(iter) ⇒ nil

Selects the specified iterator.

Parameters:

  • iter (Gtk::TreeIter)

    The Gtk::TreeIter to be selected.

Returns:

  • (nil)

#select_path(path) ⇒ nil

Select the row at path.

Parameters:

  • path (Gtk::TreePath)

    The Gtk::TreePath to be selected.

Returns:

  • (nil)

#select_range(start_path, end_path) ⇒ nil

Selects a range of nodes, determined by start_path and end_path inclusive. selection must be set to #GTK_SELECTION_MULTIPLE mode.

Parameters:

  • start_path (Gtk::TreePath)

    The initial node of the range.

  • end_path (Gtk::TreePath)

    The final node of the range.

Returns:

  • (nil)

#selected_foreach(func, data) ⇒ nil

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

Parameters:

  • func (Gtk::TreeSelectionForeachFunc)

    The function to call for each selected node.

  • data (GObject)

    user data to pass to the function.

Returns:

  • (nil)

#set_select_function(func, data, destroy) ⇒ nil

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.

Parameters:

  • func (Gtk::TreeSelectionFunc)

    The selection function. May be nil

  • data (GObject)

    The selection function’s data. May be nil

  • destroy (GLib::DestroyNotify)

    The destroy function for user data. May be nil

Returns:

  • (nil)

#tree_viewGtk::TreeView

Returns the tree view associated with selection.

Returns:

#unselect_allnil

Unselects all the nodes.

Returns:

  • (nil)

#unselect_iter(iter) ⇒ nil

Unselects the specified iterator.

Parameters:

  • iter (Gtk::TreeIter)

    The Gtk::TreeIter to be unselected.

Returns:

  • (nil)

#unselect_path(path) ⇒ nil

Unselects the row at path.

Parameters:

  • path (Gtk::TreePath)

    The Gtk::TreePath to be unselected.

Returns:

  • (nil)

#unselect_range(start_path, end_path) ⇒ nil

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

Parameters:

  • start_path (Gtk::TreePath)

    The initial node of the range.

  • end_path (Gtk::TreePath)

    The initial node of the range.

Returns:

  • (nil)

#user_dataGObject

Returns the user data for the selection function.

Returns:

  • (GObject)

    The user data.