Class: Gtk::TreeView

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

Instance Method Summary collapse

Instance Method Details

#activate_on_single_clickTrueClass

Gets the setting set by gtk_tree_view_set_activate_on_single_click().

Returns:

  • (TrueClass)

    true if row-activated will be emitted on a single click

#activate_on_single_click=(activate_on_single_click) ⇒ TrueClass

The activate-on-single-click property specifies whether the “row-activated” signal will be emitted after a single click.

Parameters:

  • activate_on_single_click (TrueClass)

Returns:

  • (TrueClass)

    activate-on-single-click

  • (TrueClass)

    activate-on-single-click

#activate_on_single_click?TrueClass

The activate-on-single-click property specifies whether the “row-activated” signal will be emitted after a single click.

Returns:

  • (TrueClass)

    activate-on-single-click

#append_column(column) ⇒ Integer

Appends column to the list of columns. If tree_view has “fixed_height” mode enabled, then column must have its “sizing” property set to be GTK_TREE_VIEW_COLUMN_FIXED.

Parameters:

Returns:

  • (Integer)

    The number of columns in tree_view after appending.

#bin_windowGdk::Window

Returns the window that tree_view renders to. This is used primarily to compare to ‘event->window` to confirm that the event on tree_view is on the right window. hasn’t been realized yet.

Returns:

  • (Gdk::Window)

    A Gdk::Window, or nil when tree_view

#collapse_allnil

Recursively collapses all visible, expanded nodes in tree_view.

Returns:

  • (nil)

#collapse_row(path) ⇒ TrueClass

Collapses a row (hides its child rows, if they exist).

Parameters:

  • path (Gtk::TreePath)

    path to a row in the tree_view

Returns:

  • (TrueClass)

    true if the row was collapsed.

#columnsGLib::List

Returns a #GList of all the Gtk::TreeViewColumn s currently in tree_view. The returned list must be freed with g_list_free ().

Returns:

  • (GLib::List)

    A list of Gtk::TreeViewColumn s

#columns_autosizenil

Resizes all columns to their optimal width. Only works after the treeview has been realized.

Returns:

  • (nil)

#convert_bin_window_to_tree_coords(bx, by, tx, ty) ⇒ nil

Converts bin_window coordinates to coordinates for the tree (the full scrollable area of the tree).

Parameters:

  • bx (Integer)

    X coordinate relative to bin_window

  • by (Integer)

    Y coordinate relative to bin_window

  • tx (Integer)

    return location for tree X coordinate

  • ty (Integer)

    return location for tree Y coordinate

Returns:

  • (nil)

#convert_bin_window_to_widget_coords(bx, by, wx, wy) ⇒ nil

Converts bin_window coordinates (see gtk_tree_view_get_bin_window()) to widget relative coordinates.

Parameters:

  • bx (Integer)

    bin_window X coordinate

  • by (Integer)

    bin_window Y coordinate

  • wx (Integer)

    return location for widget X coordinate

  • wy (Integer)

    return location for widget Y coordinate

Returns:

  • (nil)

#convert_tree_to_bin_window_coords(tx, ty, bx, by) ⇒ nil

Converts tree coordinates (coordinates in full scrollable area of the tree) to bin_window coordinates.

Parameters:

  • tx (Integer)

    tree X coordinate

  • ty (Integer)

    tree Y coordinate

  • bx (Integer)

    return location for X coordinate relative to bin_window

  • by (Integer)

    return location for Y coordinate relative to bin_window

Returns:

  • (nil)

#convert_tree_to_widget_coords(tx, ty, wx, wy) ⇒ nil

Converts tree coordinates (coordinates in full scrollable area of the tree) to widget coordinates.

Parameters:

  • tx (Integer)

    X coordinate relative to the tree

  • ty (Integer)

    Y coordinate relative to the tree

  • wx (Integer)

    return location for widget X coordinate

  • wy (Integer)

    return location for widget Y coordinate

Returns:

  • (nil)

#convert_widget_to_bin_window_coords(wx, wy, bx, by) ⇒ nil

Converts widget coordinates to coordinates for the bin_window (see gtk_tree_view_get_bin_window()).

Parameters:

  • wx (Integer)

    X coordinate relative to the widget

  • wy (Integer)

    Y coordinate relative to the widget

  • bx (Integer)

    return location for bin_window X coordinate

  • by (Integer)

    return location for bin_window Y coordinate

Returns:

  • (nil)

#convert_widget_to_tree_coords(wx, wy, tx, ty) ⇒ nil

Converts widget coordinates to coordinates for the tree (the full scrollable area of the tree).

Parameters:

  • wx (Integer)

    X coordinate relative to the widget

  • wy (Integer)

    Y coordinate relative to the widget

  • tx (Integer)

    return location for tree X coordinate

  • ty (Integer)

    return location for tree Y coordinate

Returns:

  • (nil)

#create_row_drag_icon(path) ⇒ cairo::Surface

Creates a #cairo_surface_t representation of the row at path. This image is used for a drag icon.

Parameters:

  • path (Gtk::TreePath)

    a Gtk::TreePath in tree_view

Returns:

  • (cairo::Surface)

    a newly-allocated surface of the drag icon.

#enable_grid_linesGtk::TreeViewGridLines

Returns enable-grid-lines.

Returns:

#enable_grid_lines=(enable_grid_lines) ⇒ Gtk::TreeViewGridLines

Parameters:

Returns:

#enable_model_drag_dest(targets, n_targets, actions) ⇒ nil

Turns tree_view into a drop destination for automatic DND. Calling this method sets Gtk::TreeView:reorderable to false.

Parameters:

  • targets (Array<Gtk::TargetEntry>)

    the table of targets that the drag will support

  • n_targets (Integer)

    the number of items in targets

  • actions (Gdk::DragAction)

    the bitmask of possible actions for a drag from this widget

Returns:

  • (nil)

#enable_model_drag_source(start_button_mask, targets, n_targets, actions) ⇒ nil

Turns tree_view into a drag source for automatic DND. Calling this method sets Gtk::TreeView:reorderable to false.

Parameters:

  • start_button_mask (Gdk::ModifierType)

    Mask of allowed buttons to start drag

  • targets (Array<Gtk::TargetEntry>)

    the table of targets that the drag will support

  • n_targets (Integer)

    the number of items in targets

  • actions (Gdk::DragAction)

    the bitmask of possible actions for a drag from this widget

Returns:

  • (nil)

#enable_searchTrueClass

Returns whether or not the tree allows to start interactive searching by typing in text.

Returns:

  • (TrueClass)

    whether or not to let the user search interactively

#enable_search=(enable_search) ⇒ TrueClass

Parameters:

  • enable_search (TrueClass)

Returns:

  • (TrueClass)

    enable-search

  • (TrueClass)

    enable-search

#enable_search?TrueClass

Returns enable-search.

Returns:

  • (TrueClass)

    enable-search

#enable_tree_linesTrueClass

Returns whether or not tree lines are drawn in tree_view. otherwise.

Returns:

  • (TrueClass)

    true if tree lines are drawn in tree_view, false

#enable_tree_lines=(enable_tree_lines) ⇒ TrueClass

Parameters:

  • enable_tree_lines (TrueClass)

Returns:

  • (TrueClass)

    enable-tree-lines

  • (TrueClass)

    enable-tree-lines

#enable_tree_lines?TrueClass

Returns enable-tree-lines.

Returns:

  • (TrueClass)

    enable-tree-lines

#expand_allnil

Recursively expands all nodes in the tree_view.

Returns:

  • (nil)

#expand_row(path, open_all) ⇒ TrueClass

Opens the row so its children are visible.

Parameters:

  • path (Gtk::TreePath)

    path to a row

  • open_all (TrueClass)

    whether to recursively expand, or just expand immediate children

Returns:

  • (TrueClass)

    true if the row existed and had children

#expand_to_path(path) ⇒ nil

Expands the row at path. This will also expand all parent rows of path as necessary.

Parameters:

  • path (Gtk::TreePath)

    path to a row.

Returns:

  • (nil)

#expander_columnGtk::TreeViewColumn

Returns expander-column.

Returns:

#expander_column=(expander_column) ⇒ Gtk::TreeViewColumn

Parameters:

Returns:

#fixed_height_modeTrueClass

Returns whether fixed height mode is turned on for tree_view.

Returns:

  • (TrueClass)

    true if tree_view is in fixed height mode

#fixed_height_mode=(fixed_height_mode) ⇒ TrueClass

Setting the ::fixed-height-mode property to true speeds up Gtk::TreeView by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.

Parameters:

  • fixed_height_mode (TrueClass)

Returns:

  • (TrueClass)

    fixed-height-mode

  • (TrueClass)

    fixed-height-mode

#fixed_height_mode?TrueClass

Setting the ::fixed-height-mode property to true speeds up Gtk::TreeView by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.

Returns:

  • (TrueClass)

    fixed-height-mode

#get_background_area(path, column, rect) ⇒ nil

Fills the bounding rectangle in bin_window coordinates for the cell at the row specified by path and the column specified by column. If path is nil, or points to a node not found in the tree, the y and height fields of the rectangle will be filled with 0. If column is nil, the x and width fields will be filled with 0. The returned rectangle is equivalent to the background_area passed to gtk_cell_renderer_render(). These background areas tile to cover the entire bin window. Contrast with the cell_area, returned by gtk_tree_view_get_cell_area(), which returns only the cell itself, excluding surrounding borders and the tree expander area.

Parameters:

  • path (Gtk::TreePath)

    a Gtk::TreePath for the row, or nil to get only horizontal coordinates

  • column (Gtk::TreeViewColumn)

    a Gtk::TreeViewColumn for the column, or nil to get only vertical coordiantes

  • rect (Gdk::Rectangle)

    rectangle to fill with cell background rect

Returns:

  • (nil)

#get_cell_area(path, column, rect) ⇒ nil

Fills the bounding rectangle in bin_window coordinates for the cell at the row specified by path and the column specified by column. If path is nil, or points to a path not currently displayed, the y and height fields of the rectangle will be filled with 0. If column is nil, the x and width fields will be filled with 0. The sum of all cell rects does not cover the entire tree; there are extra pixels in between rows, for example. The returned rectangle is equivalent to the cell_area passed to gtk_cell_renderer_render(). This function is only valid if tree_view is realized.

Parameters:

  • path (Gtk::TreePath)

    a Gtk::TreePath for the row, or nil to get only horizontal coordinates

  • column (Gtk::TreeViewColumn)

    a Gtk::TreeViewColumn for the column, or nil to get only vertical coordinates

  • rect (Gdk::Rectangle)

    rectangle to fill with cell rect

Returns:

  • (nil)

#get_column(n) ⇒ Gtk::TreeViewColumn

Gets the Gtk::TreeViewColumn at the given position in the #tree_view. position is outside the range of columns.

Parameters:

  • n (Integer)

    The position of the column, counting from 0.

Returns:

#get_cursor(path, focus_column) ⇒ nil

Fills in path and focus_column with the current path and focus column. If the cursor isn’t currently set, then *path will be nil. If no column currently has focus, then *focus_column will be nil.

The returned Gtk::TreePath must be freed with gtk_tree_path_free() when you are done with it.

Parameters:

  • path (Gtk::TreePath)

    A pointer to be filled with the current cursor path, or nil

  • focus_column (Gtk::TreeViewColumn)

    A pointer to be filled with the current focus column, or nil

Returns:

  • (nil)

#get_dest_row_at_pos(drag_x, drag_y, path, pos) ⇒ TrueClass

Determines the destination row for a given position. drag_x and drag_y are expected to be in widget coordinates. This function is only meaningful if tree_view is realized. Therefore this function will always return false if tree_view is not realized or does not have a model. is indeed the case.

Parameters:

  • drag_x (Integer)

    the position to determine the destination row for

  • drag_y (Integer)

    the position to determine the destination row for

  • path (Gtk::TreePath)

    Return location for the path of the highlighted row, or nil.

  • pos (Gtk::TreeViewDropPosition)

    Return location for the drop position, or nil

Returns:

  • (TrueClass)

    whether there is a row at the given position, true if this

#get_drag_dest_row(path, pos) ⇒ nil

Gets information about the row that is highlighted for feedback.

Parameters:

  • path (Gtk::TreePath)

    Return location for the path of the highlighted row, or nil.

  • pos (Gtk::TreeViewDropPosition)

    Return location for the drop position, or nil

Returns:

  • (nil)

#get_path_at_pos(x, y, path, column, cell_x, cell_y) ⇒ TrueClass

Finds the path at the point (x, y), relative to bin_window coordinates (please see gtk_tree_view_get_bin_window()). That is, x and y are relative to an events coordinates. x and y must come from an event on the tree_view only where ‘event->window == gtk_tree_view_get_bin_window ()`. It is primarily for things like popup menus. If path is non-nil, then it will be filled with the Gtk::TreePath at that point. This path should be freed with gtk_tree_path_free(). If column is non-nil, then it will be filled with the column at that point. cell_x and cell_y return the coordinates relative to the cell background (i.e. the background_area passed to gtk_cell_renderer_render()). This function is only meaningful if tree_view is realized. Therefore this function will always return false if tree_view is not realized or does not have a model.

For converting widget coordinates (eg. the ones you get from GtkWidget::query-tooltip), please see gtk_tree_view_convert_widget_to_bin_window_coords().

Parameters:

  • x (Integer)

    The x position to be identified (relative to bin_window).

  • y (Integer)

    The y position to be identified (relative to bin_window).

  • path (Gtk::TreePath)

    A pointer to a Gtk::TreePath pointer to be filled in, or nil

  • column (Gtk::TreeViewColumn)

    A pointer to a Gtk::TreeViewColumn pointer to be filled in, or nil

  • cell_x (Integer)

    A pointer where the X coordinate relative to the cell can be placed, or nil

  • cell_y (Integer)

    A pointer where the Y coordinate relative to the cell can be placed, or nil

Returns:

  • (TrueClass)

    true if a row exists at that coordinate.

#get_tooltip_context(x, y, keyboard_tip, model, path, iter) ⇒ TrueClass

This function is supposed to be used in a Gtk::Widget::query-tooltip signal handler for Gtk::TreeView. The x, y and keyboard_tip values which are received in the signal handler, should be passed to this function without modification.

The return value indicates whether there is a tree view row at the given coordinates (true) or not (false) for mouse tooltips. For keyboard tooltips the row returned will be the cursor row. When true, then any of model, path and iter which have been provided will be set to point to that row and the corresponding model. x and y will always be converted to be relative to tree_view’s bin_window if keyboard_tooltip is false.

Parameters:

  • x (Integer)

    the x coordinate (relative to widget coordinates)

  • y (Integer)

    the y coordinate (relative to widget coordinates)

  • keyboard_tip (TrueClass)

    whether this is a keyboard tooltip or not

  • model (Gtk::TreeModel)

    a pointer to receive a Gtk::TreeModel or nil

  • path (Gtk::TreePath)

    a pointer to receive a Gtk::TreePath or nil

  • iter (Gtk::TreeIter)

    a pointer to receive a Gtk::TreeIter or nil

Returns:

  • (TrueClass)

    whether or not the given tooltip context points to a row.

#get_visible_range(start_path, end_path) ⇒ TrueClass

Sets start_path and end_path to be the first and last visible path. Note that there may be invisible paths in between.

The paths should be freed with gtk_tree_path_free() after use.

Parameters:

  • start_path (Gtk::TreePath)

    Return location for start of region, or nil.

  • end_path (Gtk::TreePath)

    Return location for end of region, or nil.

Returns:

  • (TrueClass)

    true, if valid paths were placed in start_path and end_path.

#get_visible_rect(visible_rect) ⇒ nil

Fills visible_rect with the currently-visible region of the buffer, in tree coordinates. Convert to bin_window coordinates with gtk_tree_view_convert_tree_to_bin_window_coords(). Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire scrollable area of the tree.

Parameters:

  • visible_rect (Gdk::Rectangle)

    rectangle to fill

Returns:

  • (nil)

#grid_linesGtk::TreeViewGridLines

Returns which grid lines are enabled in tree_view. are enabled.

Returns:

#grid_lines=(grid_lines) ⇒ nil

Sets which grid lines to draw in tree_view. enable.

Parameters:

Returns:

  • (nil)

#hadjustmentGtk::Adjustment

Gets the Gtk::Adjustment currently being used for the horizontal aspect.

Returns:

  • (Gtk::Adjustment)

    A Gtk::Adjustment object, or nil if none is currently being used.

#hadjustment=(adjustment) ⇒ nil

Sets the Gtk::Adjustment for the current horizontal aspect.

Parameters:

Returns:

  • (nil)

#headers_clickableTrueClass

Returns whether all header columns are clickable.

Returns:

  • (TrueClass)

    true if all header columns are clickable, otherwise false

#headers_clickable=(headers_clickable) ⇒ TrueClass

Parameters:

  • headers_clickable (TrueClass)

Returns:

  • (TrueClass)

    headers-clickable

  • (TrueClass)

    headers-clickable

#headers_clickable?TrueClass

Returns headers-clickable.

Returns:

  • (TrueClass)

    headers-clickable

#headers_visibleTrueClass

Returns true if the headers on the tree_view are visible.

Returns:

  • (TrueClass)

    Whether the headers are visible or not.

#headers_visible=(headers_visible) ⇒ TrueClass

Parameters:

  • headers_visible (TrueClass)

Returns:

  • (TrueClass)

    headers-visible

  • (TrueClass)

    headers-visible

#headers_visible?TrueClass

Returns headers-visible.

Returns:

  • (TrueClass)

    headers-visible

#hover_expandTrueClass

Returns whether hover expansion mode is turned on for tree_view.

Returns:

  • (TrueClass)

    true if tree_view is in hover expansion mode

#hover_expand=(hover_expand) ⇒ TrueClass

Enables or disables the hover expansion mode of tree_view. Hover expansion makes rows expand or collapse if the pointer moves over them.

This mode is primarily intended for treeviews in popups, e.g. in Gtk::ComboBox or #GtkEntryCompletion.

Parameters:

  • hover_expand (TrueClass)

Returns:

  • (TrueClass)

    hover-expand

  • (TrueClass)

    hover-expand

#hover_expand?TrueClass

Enables or disables the hover expansion mode of tree_view. Hover expansion makes rows expand or collapse if the pointer moves over them.

This mode is primarily intended for treeviews in popups, e.g. in Gtk::ComboBox or #GtkEntryCompletion.

Returns:

  • (TrueClass)

    hover-expand

#hover_selectionTrueClass

Returns whether hover selection mode is turned on for tree_view.

Returns:

  • (TrueClass)

    true if tree_view is in hover selection mode

#hover_selection=(hover_selection) ⇒ TrueClass

Enables or disables the hover selection mode of tree_view. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes %GTK_SELECTION_SINGLE and %GTK_SELECTION_BROWSE.

This mode is primarily intended for treeviews in popups, e.g. in Gtk::ComboBox or #GtkEntryCompletion.

Parameters:

  • hover_selection (TrueClass)

Returns:

  • (TrueClass)

    hover-selection

  • (TrueClass)

    hover-selection

#hover_selection?TrueClass

Enables or disables the hover selection mode of tree_view. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes %GTK_SELECTION_SINGLE and %GTK_SELECTION_BROWSE.

This mode is primarily intended for treeviews in popups, e.g. in Gtk::ComboBox or #GtkEntryCompletion.

Returns:

  • (TrueClass)

    hover-selection

#insert_column(column, position) ⇒ Integer

This inserts the column into the tree_view at position. If position is -1, then the column is inserted at the end. If tree_view has “fixed_height” mode enabled, then column must have its “sizing” property set to be GTK_TREE_VIEW_COLUMN_FIXED.

Parameters:

  • column (Gtk::TreeViewColumn)

    The Gtk::TreeViewColumn to be inserted.

  • position (Integer)

    The position to insert column in.

Returns:

  • (Integer)

    The number of columns in tree_view after insertion.

#insert_column_with_attributes(position, title, cell, array) ⇒ Integer

Creates a new Gtk::TreeViewColumn and inserts it into the tree_view at position. If position is -1, then the newly created column is inserted at the end. The column is initialized with the attributes given. If tree_view has “fixed_height” mode enabled, then the new column will have its sizing property set to be GTK_TREE_VIEW_COLUMN_FIXED.

Parameters:

  • position (Integer)

    The position to insert the new column in

  • title (String)

    The title to set the header to

  • cell (Gtk::CellRenderer)

    The Gtk::CellRenderer

  • array (Array)

    A nil-terminated list of attributes

Returns:

  • (Integer)

    The number of columns in tree_view after insertion.

#insert_column_with_data_func(position, title, cell, func, data, dnotify) ⇒ Integer

Convenience function that inserts a new column into the Gtk::TreeView with the given cell renderer and a Gtk::TreeCellDataFunc to set cell renderer attributes (normally using data from the model). See also gtk_tree_view_column_set_cell_data_func(), gtk_tree_view_column_pack_start(). If tree_view has “fixed_height” mode enabled, then the new column will have its “sizing” property set to be GTK_TREE_VIEW_COLUMN_FIXED.

Parameters:

  • position (Integer)

    Position to insert, -1 for append

  • title (String)

    column title

  • cell (Gtk::CellRenderer)

    cell renderer for column

  • func (Gtk::TreeCellDataFunc)

    function to set attributes of cell renderer

  • data (GObject)

    data for func

  • dnotify (GLib::DestroyNotify)

    destroy notifier for data

Returns:

  • (Integer)

    number of columns in the tree view post-insert

#is_blank_at_pos(x, y, path, column, cell_x, cell_y) ⇒ TrueClass

Determine whether the point (x, y) in tree_view is blank, that is no cell content nor an expander arrow is drawn at the location. If so, the location can be considered as the background. You might wish to take special action on clicks on the background, such as clearing a current selection, having a custom context menu or starting rubber banding.

The x and y coordinate that are provided must be relative to bin_window coordinates. That is, x and y must come from an event on tree_view where ‘event->window == gtk_tree_view_get_bin_window ()`.

For converting widget coordinates (eg. the ones you get from GtkWidget::query-tooltip), please see gtk_tree_view_convert_widget_to_bin_window_coords().

The path, column, cell_x and cell_y arguments will be filled in likewise as for gtk_tree_view_get_path_at_pos(). Please see gtk_tree_view_get_path_at_pos() for more information. false otherwise.

Parameters:

  • x (Integer)

    The x position to be identified (relative to bin_window)

  • y (Integer)

    The y position to be identified (relative to bin_window)

  • path (Gtk::TreePath)

    A pointer to a Gtk::TreePath pointer to be filled in, or nil

  • column (Gtk::TreeViewColumn)

    A pointer to a Gtk::TreeViewColumn pointer to be filled in, or nil

  • cell_x (Integer)

    A pointer where the X coordinate relative to the cell can be placed, or nil

  • cell_y (Integer)

    A pointer where the Y coordinate relative to the cell can be placed, or nil

Returns:

  • (TrueClass)

    true if the area at the given coordinates is blank,

#is_rubber_banding_activeTrueClass

Returns whether a rubber banding operation is currently being done in tree_view. done in tree_view.

Returns:

  • (TrueClass)

    true if a rubber banding operation is currently being

#level_indentationInteger

Extra indentation for each level.

Returns:

  • (Integer)

    level-indentation

#level_indentation=(level_indentation) ⇒ Integer

Extra indentation for each level.

Parameters:

  • level_indentation (Integer)

Returns:

  • (Integer)

    level-indentation

  • (Integer)

    level-indentation

#map_expanded_rows(func, data) ⇒ nil

Calls func on all expanded rows.

Parameters:

  • func (Gtk::TreeViewMappingFunc)

    A function to be called

  • data (GObject)

    User data to be passed to the function.

Returns:

  • (nil)

#modelGtk::TreeModel

Returns model.

Returns:

#model=(model) ⇒ Gtk::TreeModel

Parameters:

Returns:

#move_column_after(column, base_column) ⇒ nil

Moves column to be after to base_column. If base_column is nil, then column is placed in the first position.

Parameters:

Returns:

  • (nil)

#n_columnsInteger

Queries the number of columns in the given tree_view.

Returns:

  • (Integer)

    The number of columns in the tree_view

#newGtk::Widget

Creates a new Gtk::TreeView widget.

Returns:

  • (Gtk::Widget)

    A newly created Gtk::TreeView widget.

#new_with_model(model) ⇒ Gtk::Widget

Creates a new Gtk::TreeView widget with the model initialized to model.

Parameters:

Returns:

  • (Gtk::Widget)

    A newly created Gtk::TreeView widget.

#remove_column(column) ⇒ Integer

Removes column from tree_view.

Parameters:

Returns:

  • (Integer)

    The number of columns in tree_view after removing.

#reorderableTrueClass

Retrieves whether the user can reorder the tree via drag-and-drop. See gtk_tree_view_set_reorderable().

Returns:

  • (TrueClass)

    true if the tree can be reordered.

#reorderable=(reorderable) ⇒ TrueClass

Parameters:

  • reorderable (TrueClass)

Returns:

  • (TrueClass)

    reorderable

  • (TrueClass)

    reorderable

#reorderable?TrueClass

Returns reorderable.

Returns:

  • (TrueClass)

    reorderable

#row_activated(path, column) ⇒ nil

Activates the cell determined by path and column.

Parameters:

  • path (Gtk::TreePath)

    The Gtk::TreePath to be activated.

  • column (Gtk::TreeViewColumn)

    The Gtk::TreeViewColumn to be activated.

Returns:

  • (nil)

#row_expanded(path) ⇒ TrueClass

Returns true if the node pointed to by path is expanded in tree_view.

Parameters:

  • path (Gtk::TreePath)

    A Gtk::TreePath to test expansion state.

Returns:

  • (TrueClass)

    true if #path is expanded.

#row_separator_funcGtk::TreeViewRowSeparatorFunc

Returns the current row separator function.

Returns:

  • (Gtk::TreeViewRowSeparatorFunc)

    the current row separator function.

#rubber_bandingTrueClass

Returns whether rubber banding is turned on for tree_view. If the selection mode is #GTK_SELECTION_MULTIPLE, rubber banding will allow the user to select multiple rows by dragging the mouse.

Returns:

  • (TrueClass)

    true if rubber banding in tree_view is enabled.

#rubber_banding=(rubber_banding) ⇒ TrueClass

Parameters:

  • rubber_banding (TrueClass)

Returns:

  • (TrueClass)

    rubber-banding

  • (TrueClass)

    rubber-banding

#rubber_banding?TrueClass

Returns rubber-banding.

Returns:

  • (TrueClass)

    rubber-banding

#rules_hintTrueClass

Gets the setting set by gtk_tree_view_set_rules_hint().

Returns:

  • (TrueClass)

    true if the hint is set

#rules_hint=(rules_hint) ⇒ TrueClass

Sets a hint to the theme to draw rows in alternating colors.

Parameters:

  • rules_hint (TrueClass)

Returns:

  • (TrueClass)

    rules-hint

  • (TrueClass)

    rules-hint

#rules_hint?TrueClass

Sets a hint to the theme to draw rows in alternating colors.

Returns:

  • (TrueClass)

    rules-hint

#scroll_to_cell(path, column, use_align, row_align, col_align) ⇒ nil

Moves the alignments of tree_view to the position specified by column and path. If column is nil, then no horizontal scrolling occurs. Likewise, if path is nil no vertical scrolling occurs. At a minimum, one of column or path need to be non-nil. row_align determines where the row is placed, and col_align determines where column is placed. Both are expected to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means center.

If use_align is false, then the alignment arguments are ignored, and the tree does the minimum amount of work to scroll the cell onto the screen. This means that the cell will be scrolled to the edge closest to its current position. If the cell is currently visible on the screen, nothing is done.

This function only works if the model is set, and path is a valid row on the model. If the model changes before the tree_view is realized, the centered path will be modified to reflect this change.

Parameters:

  • path (Gtk::TreePath)

    The path of the row to move to, or nil.

  • column (Gtk::TreeViewColumn)

    The Gtk::TreeViewColumn to move horizontally to, or nil.

  • use_align (TrueClass)

    whether to use alignment arguments, or false.

  • row_align (Gtk::gfloat)

    The vertical alignment of the row specified by path.

  • col_align (Gtk::gfloat)

    The horizontal alignment of the column specified by column.

Returns:

  • (nil)

#scroll_to_point(tree_x, tree_y) ⇒ nil

Scrolls the tree view such that the top-left corner of the visible area is tree_x, tree_y, where tree_x and tree_y are specified in tree coordinates. The tree_view must be realized before this function is called. If it isn’t, you probably want to be using gtk_tree_view_scroll_to_cell().

If either tree_x or tree_y are -1, then that direction isn’t scrolled.

Parameters:

  • tree_x (Integer)

    X coordinate of new top-left pixel of visible area, or -1

  • tree_y (Integer)

    Y coordinate of new top-left pixel of visible area, or -1

Returns:

  • (nil)

#search_columnInteger

Returns search-column.

Returns:

  • (Integer)

    search-column

#search_column=(search_column) ⇒ Integer

Parameters:

  • search_column (Integer)

Returns:

  • (Integer)

    search-column

  • (Integer)

    search-column

#search_entryGtk::Entry

Returns the Gtk::Entry which is currently in use as interactive search entry for tree_view. In case the built-in entry is being used, nil will be returned.

Returns:

  • (Gtk::Entry)

    the entry currently in use as search entry.

#search_entry=(entry) ⇒ nil

Sets the entry which the interactive search code will use for this tree_view. This is useful when you want to provide a search entry in our interface at all time at a fixed position. Passing nil for entry will make the interactive search code use the built-in popup entry again.

Parameters:

  • entry (Gtk::Entry)

    the entry the interactive search code of tree_view should use or nil

Returns:

  • (nil)

#search_equal_funcGtk::TreeViewSearchEqualFunc

Returns the compare function currently in use.

Returns:

  • (Gtk::TreeViewSearchEqualFunc)

    the currently used compare function for the search code.

#search_position_funcGtk::TreeViewSearchPositionFunc

Returns the positioning function currently in use.

Returns:

  • (Gtk::TreeViewSearchPositionFunc)

    the currently used function for positioning the search dialog.

#selectionGtk::TreeSelection

Gets the Gtk::TreeSelection associated with tree_view.

Returns:

#set_column_drag_function(func, user_data, destroy) ⇒ nil

Sets a user function for determining where a column may be dropped when dragged. This function is called on every column pair in turn at the beginning of a column drag to determine where a drop can take place. The arguments passed to func are: the tree_view, the Gtk::TreeViewColumn being dragged, the two Gtk::TreeViewColumn s determining the drop spot, and user_data. If either of the Gtk::TreeViewColumn arguments for the drop spot are nil, then they indicate an edge. If func is set to be nil, then tree_view reverts to the default behavior of allowing all columns to be dropped everywhere.

Parameters:

  • func (Gtk::TreeViewColumnDropFunc)

    A function to determine which columns are reorderable, or nil.

  • user_data (GObject)

    User data to be passed to func, or nil

  • destroy (GLib::DestroyNotify)

    Destroy notifier for user_data, or nil

Returns:

  • (nil)

#set_cursor(path, focus_column, start_editing) ⇒ nil

Sets the current keyboard focus to be at path, and selects it. This is useful when you want to focus the user’s attention on a particular row. If focus_column is not nil, then focus is given to the column specified by it. Additionally, if focus_column is specified, and start_editing is true, then editing should be started in the specified cell. This function is often followed by gtk_widget_grab_focus (tree_view) in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.

If path is invalid for model, the current cursor (if any) will be unset and the function will return without failing.

Parameters:

  • path (Gtk::TreePath)

    A Gtk::TreePath

  • focus_column (Gtk::TreeViewColumn)

    A Gtk::TreeViewColumn, or nil

  • start_editing (TrueClass)

    true if the specified cell should start being edited.

Returns:

  • (nil)

#set_cursor_on_cell(path, focus_column, focus_cell, start_editing) ⇒ nil

Sets the current keyboard focus to be at path, and selects it. This is useful when you want to focus the user’s attention on a particular row. If focus_column is not nil, then focus is given to the column specified by it. If focus_column and focus_cell are not nil, and focus_column contains 2 or more editable or activatable cells, then focus is given to the cell specified by focus_cell. Additionally, if focus_column is specified, and start_editing is true, then editing should be started in the specified cell. This function is often followed by gtk_widget_grab_focus (tree_view) in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.

If path is invalid for model, the current cursor (if any) will be unset and the function will return without failing.

Parameters:

  • path (Gtk::TreePath)

    A Gtk::TreePath

  • focus_column (Gtk::TreeViewColumn)

    A Gtk::TreeViewColumn, or nil

  • focus_cell (Gtk::CellRenderer)

    A Gtk::CellRenderer, or nil

  • start_editing (TrueClass)

    true if the specified cell should start being edited.

Returns:

  • (nil)

#set_destroy_count_func(func, data, destroy) ⇒ nil

This function should almost never be used. It is meant for private use by ATK for determining the number of visible children that are removed when the user collapses a row, or a row is deleted.

Parameters:

  • func (Gtk::TreeDestroyCountFunc)

    Function to be called when a view row is destroyed, or nil

  • data (GObject)

    User data to be passed to func, or nil

  • destroy (GLib::DestroyNotify)

    Destroy notifier for data, or nil

Returns:

  • (nil)

#set_drag_dest_row(path, pos) ⇒ nil

Sets the row that is highlighted for feedback. If path is nil, an existing highlight is removed.

Parameters:

  • path (Gtk::TreePath)

    The path of the row to highlight, or nil

  • pos (Gtk::TreeViewDropPosition)

    Specifies whether to drop before, after or into the row

Returns:

  • (nil)

#set_row_separator_func(func, data, destroy) ⇒ nil

Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is nil, no separators are drawn. This is the default value.

Parameters:

  • func (Gtk::TreeViewRowSeparatorFunc)

    a Gtk::TreeViewRowSeparatorFunc

  • data (GObject)

    user data to pass to func, or nil

  • destroy (GLib::DestroyNotify)

    destroy notifier for data, or nil

Returns:

  • (nil)

#set_search_equal_func(search_equal_func, search_user_data, search_destroy) ⇒ nil

Sets the compare function for the interactive search capabilities; note that somewhat like strcmp() returning 0 for equality Gtk::TreeViewSearchEqualFunc returns false on matches.

Parameters:

  • search_equal_func (Gtk::TreeViewSearchEqualFunc)

    the compare function to use during the search

  • search_user_data (GObject)

    user data to pass to search_equal_func, or nil

  • search_destroy (GLib::DestroyNotify)

    Destroy notifier for search_user_data, or nil

Returns:

  • (nil)

#set_search_position_func(func, data, destroy) ⇒ nil

Sets the function to use when positioning the search dialog.

Parameters:

  • func (Gtk::TreeViewSearchPositionFunc)

    the function to use to position the search dialog, or nil to use the default search position function

  • data (GObject)

    user data to pass to func, or nil

  • destroy (GLib::DestroyNotify)

    Destroy notifier for data, or nil

Returns:

  • (nil)

#set_tooltip_cell(tooltip, path, column, cell) ⇒ nil

Sets the tip area of tooltip to the area path, column and cell have in common. For example if path is nil and column is set, the tip area will be set to the full area covered by column. See also gtk_tooltip_set_tip_area().

Note that if path is not specified and cell is set and part of a column containing the expander, the tooltip might not show and hide at the correct position. In such cases path must be set to the current node under the mouse cursor for this function to operate correctly.

See also gtk_tree_view_set_tooltip_column() for a simpler alternative.

Parameters:

Returns:

  • (nil)

#set_tooltip_row(tooltip, path) ⇒ nil

Sets the tip area of tooltip to be the area covered by the row at path. See also gtk_tree_view_set_tooltip_column() for a simpler alternative. See also gtk_tooltip_set_tip_area().

Parameters:

  • tooltip (Gtk::Tooltip)

    a Gtk::Tooltip

  • path (Gtk::TreePath)

    a Gtk::TreePath

Returns:

  • (nil)

#show_expandersTrueClass

Returns whether or not expanders are drawn in tree_view. otherwise.

Returns:

  • (TrueClass)

    true if expanders are drawn in tree_view, false

#show_expanders=(show_expanders) ⇒ TrueClass

true if the view has expanders.

Parameters:

  • show_expanders (TrueClass)

Returns:

  • (TrueClass)

    show-expanders

  • (TrueClass)

    show-expanders

#show_expanders?TrueClass

true if the view has expanders.

Returns:

  • (TrueClass)

    show-expanders

#tooltip_columnInteger

Returns tooltip-column.

Returns:

  • (Integer)

    tooltip-column

#tooltip_column=(tooltip_column) ⇒ Integer

Parameters:

  • tooltip_column (Integer)

Returns:

  • (Integer)

    tooltip-column

  • (Integer)

    tooltip-column

#ubuntu_almost_fixed_height_mode=(ubuntu_almost_fixed_height_mode) ⇒ TrueClass

Returns ubuntu-almost-fixed-height-mode.

Parameters:

  • ubuntu_almost_fixed_height_mode (TrueClass)

Returns:

  • (TrueClass)

    ubuntu-almost-fixed-height-mode

#unset_rows_drag_destnil

Undoes the effect of gtk_tree_view_enable_model_drag_dest(). Calling this method sets Gtk::TreeView:reorderable to false.

Returns:

  • (nil)

#unset_rows_drag_sourcenil

Undoes the effect of gtk_tree_view_enable_model_drag_source(). Calling this method sets Gtk::TreeView:reorderable to false.

Returns:

  • (nil)

#vadjustmentGtk::Adjustment

Gets the Gtk::Adjustment currently being used for the vertical aspect.

Returns:

  • (Gtk::Adjustment)

    A Gtk::Adjustment object, or nil if none is currently being used.

#vadjustment=(adjustment) ⇒ nil

Sets the Gtk::Adjustment for the current vertical aspect.

Parameters:

Returns:

  • (nil)