Gtk2::TreeView(3) User Contributed Perl Documentation Gtk2::TreeView(3) NAME Gtk2::TreeView - wrapper for GtkTreeView HIERARCHY Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::TreeView INTERFACES Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable METHODS widget = Gtk2::TreeView->new ($model=undef) o $model (Gtk2::TreeModel) widget = Gtk2::TreeView->new_with_model ($model) o $model (Gtk2::TreeModel) integer = $tree_view->append_column ($column) o $column (Gtk2::TreeViewColumn) rectangle = $tree_view->get_background_area ($path, $column) o $path (Gtk2::TreePath or undef) o $column (Gtk2::TreeViewColumn or undef) window = $tree_view->get_bin_window rectangle = $tree_view->get_cell_area ($path, $column) o $path (Gtk2::TreePath or undef) o $column (Gtk2::TreeViewColumn or undef) $tree_view->collapse_all boolean = $tree_view->collapse_row ($path) o $path (Gtk2::TreePath) $tree_view->set_column_drag_function ($func, $data=undef) o $func (scalar) o $data (scalar) treeviewcolumn = $tree_view->get_column ($n) o $n (integer) $tree_view->columns_autosize list = $tree_view->get_columns Returns an array of columns. (tx, ty) = $tree_view->convert_bin_window_to_tree_coords ($bx, $by) o $bx (integer) o $by (integer) Since: gtk+ 2.12 (wx, wy) = $tree_view->convert_bin_window_to_widget_coords ($bx, $by) o $bx (integer) o $by (integer) Since: gtk+ 2.12 (bx, by) = $tree_view->convert_tree_to_bin_window_coords ($tx, $ty) o $tx (integer) o $ty (integer) Since: gtk+ 2.12 (wx, wy) = $tree_view->convert_tree_to_widget_coords ($tx, $ty) o $tx (integer) o $ty (integer) Since: gtk+ 2.12 (bx, by) = $tree_view->convert_widget_to_bin_window_coords ($wx, $wy) o $wx (integer) o $wy (integer) Since: gtk+ 2.12 (tx, ty) = $tree_view->convert_widget_to_tree_coords ($wx, $wy) o $wx (integer) o $wy (integer) Since: gtk+ 2.12 pixmap = $tree_view->create_row_drag_icon ($path) o $path (Gtk2::TreePath) (path, focus_column) = $tree_view->get_cursor Returns the Gtk2::TreePath and Gtk2::TreeViewColumn of the cell with the keyboard focus cursor. Either may be undef. $tree_view->set_cursor_on_cell ($path, $focus_column, $focus_cell, $start_editing) o $path (Gtk2::TreePath) o $focus_column (Gtk2::TreeViewColumn or undef) o $focus_cell (Gtk2::CellRenderer or undef) o $start_editing (boolean) Since: gtk+ 2.2 $tree_view->set_cursor ($path, $focus_column=undef, $start_editing=FALSE) o $path (Gtk2::TreePath) o $focus_column (Gtk2::TreeViewColumn or undef) o $start_editing (boolean) (path, dropposition) = $tree_view->get_dest_row_at_pos ($drag_x, $drag_y) o $drag_x (integer) o $drag_y (integer) (path, dropposition) = $tree_view->get_drag_dest_row $tree_view->set_drag_dest_row ($path, $pos) o $path (Gtk2::TreePath or undef) o $pos (Gtk2::TreeViewDropPosition) $tree_view->enable_model_drag_dest ($actions, ...) o $actions (Gtk2::Gdk::DragAction) o ... (list) of Gtk2::TargetEntry's $tree_view->enable_model_drag_source ($start_button_mask, $actions, ...) o $start_button_mask (Gtk2::Gdk::ModifierType) o $actions (Gtk2::Gdk::DragAction) o ... (list) of Gtk2::TargetEntry's boolean = $tree_view->get_enable_search $tree_view->set_enable_search ($enable_search) o $enable_search (boolean) boolean = $tree_view->get_enable_tree_lines Since: gtk+ 2.10 $tree_view->set_enable_tree_lines ($enabled) o $enabled (boolean) Since: gtk+ 2.10 $tree_view->expand_all boolean = $tree_view->expand_row ($path, $open_all) o $path (Gtk2::TreePath) o $open_all (boolean) $tree_view->expand_to_path ($path) o $path (Gtk2::TreePath) Since: gtk+ 2.2 treeviewcolumn or undef = $tree_view->get_expander_column $tree_view->set_expander_column ($column) o $column (Gtk2::TreeViewColumn or undef) boolean = $treeview->get_fixed_height_mode Since: gtk+ 2.6 $treeview->set_fixed_height_mode ($enable) o $enable (boolean) Since: gtk+ 2.6 treeviewgridlines = $tree_view->get_grid_lines Since: gtk+ 2.10 $tree_view->set_grid_lines ($grid_lines) o $grid_lines (Gtk2::TreeViewGridLines) Since: gtk+ 2.10 adjustment or undef = $tree_view->get_hadjustment $tree_view->set_hadjustment ($adjustment) o $adjustment (Gtk2::Adjustment or undef) boolean = $tree_view->get_headers_clickable Since: gtk+ 2.10 $tree_view->set_headers_clickable ($setting) o $setting (boolean) boolean = $tree_view->get_headers_visible $tree_view->set_headers_visible ($headers_visible) o $headers_visible (boolean) boolean = $treeview->get_hover_expand Since: gtk+ 2.6 $treeview->set_hover_expand ($expand) o $expand (boolean) Since: gtk+ 2.6 boolean = $treeview->get_hover_selection Since: gtk+ 2.6 $treeview->set_hover_selection ($hover) o $hover (boolean) Since: gtk+ 2.6 integer = $tree_view->insert_column ($column, $position) o $column (Gtk2::TreeViewColumn) o $position (integer) $tree_view->insert_column_with_attributes ($position, $title, $cellrenderer, $attr1, $col1, $attr2, $col2, ...) o $position (integer) o $title (string) o $cell (Gtk2::CellRenderer) o ... (list) integer = $tree_view->insert_column_with_data_func ($position, $title, $cell, $func, $data=undef) o $position (integer) o $title (string) o $cell (Gtk2::CellRenderer) o $func (subroutine) o $data (scalar) Insert a column that calls $func every time it needs to fetch the data for a cell. $func will get a cell renderer, the tree model, and the iter of the row in question, and should set the proper value into the cell renderer. boolean = $tree_view->is_rubber_banding_active Since: gtk+ 2.12 integer = $tree_view->get_level_indentation Since: gtk+ 2.12 $tree_view->set_level_indentation ($indentation) o $indentation (integer) Since: gtk+ 2.12 $tree_view->map_expanded_rows ($func, $data=undef) o $func (scalar) o $data (scalar) treemodel or undef = $tree_view->get_model $tree_view->set_model ($model) o $model (Gtk2::TreeModel or undef) $tree_view->move_column_after ($column, $base_column) o $column (Gtk2::TreeViewColumn) o $base_column (Gtk2::TreeViewColumn or undef) path = $tree_view->get_path_at_pos ($x, $y) (path, column, cell_x, cell_y) = $tree_view->get_path_at_pos ($x, $y) o $x (integer) o $y (integer) Finds the path at the point ($x, $y), relative to widget coordinates. That is, $x and $y are relative to an event's coordinates. $x and $y must come from an event on the $tree_view only where "$event->window == $tree_view->get_bin_window". It is primarily for things like popup menus. In scalar context, returns the Gtk2::TreePath, in array context, adds the Gtk2::TreeViewColumn, and $x and $y translated to be relative to the cell. This function is only meaningful if $tree_view is realized. integer = $tree_view->remove_column ($column) o $column (Gtk2::TreeViewColumn) boolean = $tree_view->get_reorderable $tree_view->set_reorderable ($reorderable) o $reorderable (boolean) $tree_view->row_activated ($path, $column) o $path (Gtk2::TreePath) o $column (Gtk2::TreeViewColumn) boolean = $tree_view->row_expanded ($path) o $path (Gtk2::TreePath) $tree_view->set_row_separator_func ($func, $data=undef) o $func (scalar) o $data (scalar) Since: gtk+ 2.6 boolean = $tree_view->get_rubber_banding Since: gtk+ 2.10 $tree_view->set_rubber_banding ($enable) o $enable (boolean) Since: gtk+ 2.10 boolean = $tree_view->get_rules_hint $tree_view->set_rules_hint ($setting) o $setting (boolean) $tree_view->scroll_to_cell ($path, $column=undef, $use_align=FALSE, $row_align=0.0, $col_align=0.0) o $path (Gtk2::TreePath or undef) o $column (Gtk2::TreeViewColumn or undef) o $use_align (boolean) o $row_align (double) o $col_align (double) $tree_view->scroll_to_point ($tree_x, $tree_y) o $tree_x (scalar) o $tree_y (scalar) integer = $tree_view->get_search_column $tree_view->set_search_column ($column) o $column (integer) entry or undef = $tree_view->get_search_entry Since: gtk+ 2.10 $tree_view->set_search_entry ($entry) o $entry (Gtk2::Entry or undef) Since: gtk+ 2.10 $tree_view->set_search_equal_func ($func, $data=undef) o $func (subroutine) o $data (scalar) $tree_view->set_search_position_func ($func, $user_data=undef) o $func (scalar) o $user_data (scalar) Pass undef for the func to restore the default search position function. Since: gtk+ 2.10 treeselection = $tree_view->get_selection boolean = $tree_view->get_show_expanders Since: gtk+ 2.12 $tree_view->set_show_expanders ($enabled) o $enabled (boolean) Since: gtk+ 2.12 $tree_view->set_tooltip_cell ($tooltip, $path, $column, $cell) o $tooltip (Gtk2::Tooltip) o $path (Gtk2::TreePath) o $column (Gtk2::TreeViewColumn) o $cell (Gtk2::CellRenderer) Since: gtk+ 2.12 integer = $tree_view->get_tooltip_column Since: gtk+ 2.12 $tree_view->set_tooltip_column ($column) o $column (integer) Since: gtk+ 2.12 (x, y, model, path, iter) = $treeview->get_tooltip_context ($x, $y, $keyboard_tip) o $x (integer) o $y (integer) o $keyboard_tip (boolean) Since: gtk+ 2.12 $tree_view->set_tooltip_row ($tooltip, $path) o $tooltip (Gtk2::Tooltip) o $path (Gtk2::TreePath) Since: gtk+ 2.12 (wx, wy) = $tree_view->tree_to_widget_coords ($tx, $ty) o $tx (integer) o $ty (integer) $tree_view->unset_rows_drag_dest $tree_view->unset_rows_drag_source adjustment or undef = $tree_view->get_vadjustment $tree_view->set_vadjustment ($adjustment) o $adjustment (Gtk2::Adjustment or undef) (start_path, end_path) = $tree_view->get_visible_range Since: gtk+ 2.8 rectangle = $tree_view->get_visible_rect (tx, ty) = $tree_view->widget_to_tree_coords ($wx, $wy) o $wx (integer) o $wy (integer) PROPERTIES 'enable-grid-lines' (Gtk2::TreeViewGridLines : default "none" : readable / writable / private / static-nick / static-blurb) Whether grid lines should be drawn in the tree view 'enable-search' (boolean : default true : readable / writable / private / static-nick / static-blurb) View allows user to search through columns interactively 'enable-tree-lines' (boolean : default false : readable / writable / private / static-nick / static-blurb) Whether tree lines should be drawn in the tree view 'expander-column' (Gtk2::TreeViewColumn : default undef : readable / writable / private / static-nick / static-blurb) Set the column for the expander column 'fixed-height-mode' (boolean : default false : readable / writable / private / static-nick / static-blurb) Speeds up GtkTreeView by assuming that all rows have the same height 'hadjustment' (Gtk2::Adjustment : default undef : readable / writable / private / static-nick / static-blurb) Horizontal Adjustment for the widget 'headers-clickable' (boolean : default true : readable / writable / private / static-nick / static-blurb) Column headers respond to click events 'headers-visible' (boolean : default true : readable / writable / private / static-nick / static-blurb) Show the column header buttons 'hover-expand' (boolean : default false : readable / writable / private / static-nick / static-blurb) Whether rows should be expanded/collapsed when the pointer moves over them 'hover-selection' (boolean : default false : readable / writable / private / static-nick / static-blurb) Whether the selection should follow the pointer 'level-indentation' (integer : default 0 : readable / writable / private / static-nick / static-blurb) Extra indentation for each level 'model' (Gtk2::TreeModel : default undef : readable / writable / private / static-nick / static-blurb) The model for the tree view 'reorderable' (boolean : default false : readable / writable / private / static-nick / static-blurb) View is reorderable 'rubber-banding' (boolean : default false : readable / writable / private / static-nick / static-blurb) Whether to enable selection of multiple items by dragging the mouse pointer 'rules-hint' (boolean : default false : readable / writable / private / static-nick / static-blurb) Set a hint to the theme engine to draw rows in alternating colors 'search-column' (integer : default -1 : readable / writable / private / static-nick / static-blurb) Model column to search through during interactive search 'show-expanders' (boolean : default true : readable / writable / private / static-nick / static-blurb) View has expanders 'tooltip-column' (integer : default -1 : readable / writable / private / static-nick / static-blurb) The column in the model containing the tooltip texts for the rows 'vadjustment' (Gtk2::Adjustment : default undef : readable / writable / private / static-nick / static-blurb) Vertical Adjustment for the widget STYLE PROPERTIES 'allow-rules' (boolean : default true : readable / private / static-nick / static-blurb) Allow drawing of alternating color rows 'even-row-color' (Gtk2::Gdk::Color : default undef : readable / private / static-nick / static-blurb) Color to use for even rows 'expander-size' (integer : default 12 : readable / private / static-nick / static-blurb) Size of the expander arrow 'grid-line-pattern' (string : default "\1\1" : readable / private / static-nick / static-blurb) Dash pattern used to draw the tree view grid lines 'grid-line-width' (integer : default 1 : readable / private / static-nick / static-blurb) Width, in pixels, of the tree view grid lines 'horizontal-separator' (integer : default 2 : readable / private / static-nick / static-blurb) Horizontal space between cells. Must be an even number 'indent-expanders' (boolean : default true : readable / private / static-nick / static-blurb) Make the expanders indented 'odd-row-color' (Gtk2::Gdk::Color : default undef : readable / private / static-nick / static-blurb) Color to use for odd rows 'row-ending-details' (boolean : default false : readable / private / static-nick / static-blurb) Enable extended row background theming 'tree-line-pattern' (string : default "\1\1" : readable / private / static-nick / static-blurb) Dash pattern used to draw the tree view lines 'tree-line-width' (integer : default 1 : readable / private / static-nick / static-blurb) Width, in pixels, of the tree view lines 'vertical-separator' (integer : default 2 : readable / private / static-nick / static-blurb) Vertical space between cells. Must be an even number SIGNALS columns-changed (Gtk2::TreeView) cursor-changed (Gtk2::TreeView) boolean = expand-collapse-cursor-row (Gtk2::TreeView, boolean, boolean, boolean) boolean = move-cursor (Gtk2::TreeView, Gtk2::MovementStep, integer) row-activated (Gtk2::TreeView, Gtk2::TreePath, Gtk2::TreeViewColumn) row-collapsed (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath) row-expanded (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath) boolean = select-all (Gtk2::TreeView) boolean = select-cursor-parent (Gtk2::TreeView) boolean = select-cursor-row (Gtk2::TreeView, boolean) set-scroll-adjustments (Gtk2::TreeView, Gtk2::Adjustment, Gtk2::Adjustment) boolean = start-interactive-search (Gtk2::TreeView) boolean = test-collapse-row (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath) boolean = test-expand-row (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath) boolean = toggle-cursor-row (Gtk2::TreeView) boolean = unselect-all (Gtk2::TreeView) ENUMS AND FLAGS flags Gtk2::Gdk::DragAction o 'default' / 'GDK_ACTION_DEFAULT' o 'copy' / 'GDK_ACTION_COPY' o 'move' / 'GDK_ACTION_MOVE' o 'link' / 'GDK_ACTION_LINK' o 'private' / 'GDK_ACTION_PRIVATE' o 'ask' / 'GDK_ACTION_ASK' flags Gtk2::Gdk::ModifierType o 'shift-mask' / 'GDK_SHIFT_MASK' o 'lock-mask' / 'GDK_LOCK_MASK' o 'control-mask' / 'GDK_CONTROL_MASK' o 'mod1-mask' / 'GDK_MOD1_MASK' o 'mod2-mask' / 'GDK_MOD2_MASK' o 'mod3-mask' / 'GDK_MOD3_MASK' o 'mod4-mask' / 'GDK_MOD4_MASK' o 'mod5-mask' / 'GDK_MOD5_MASK' o 'button1-mask' / 'GDK_BUTTON1_MASK' o 'button2-mask' / 'GDK_BUTTON2_MASK' o 'button3-mask' / 'GDK_BUTTON3_MASK' o 'button4-mask' / 'GDK_BUTTON4_MASK' o 'button5-mask' / 'GDK_BUTTON5_MASK' o 'super-mask' / 'GDK_SUPER_MASK' o 'hyper-mask' / 'GDK_HYPER_MASK' o 'meta-mask' / 'GDK_META_MASK' o 'release-mask' / 'GDK_RELEASE_MASK' o 'modifier-mask' / 'GDK_MODIFIER_MASK' enum Gtk2::MovementStep o 'logical-positions' / 'GTK_MOVEMENT_LOGICAL_POSITIONS' o 'visual-positions' / 'GTK_MOVEMENT_VISUAL_POSITIONS' o 'words' / 'GTK_MOVEMENT_WORDS' o 'display-lines' / 'GTK_MOVEMENT_DISPLAY_LINES' o 'display-line-ends' / 'GTK_MOVEMENT_DISPLAY_LINE_ENDS' o 'paragraphs' / 'GTK_MOVEMENT_PARAGRAPHS' o 'paragraph-ends' / 'GTK_MOVEMENT_PARAGRAPH_ENDS' o 'pages' / 'GTK_MOVEMENT_PAGES' o 'buffer-ends' / 'GTK_MOVEMENT_BUFFER_ENDS' o 'horizontal-pages' / 'GTK_MOVEMENT_HORIZONTAL_PAGES' enum Gtk2::TreeViewDropPosition o 'before' / 'GTK_TREE_VIEW_DROP_BEFORE' o 'after' / 'GTK_TREE_VIEW_DROP_AFTER' o 'into-or-before' / 'GTK_TREE_VIEW_DROP_INTO_OR_BEFORE' o 'into-or-after' / 'GTK_TREE_VIEW_DROP_INTO_OR_AFTER' enum Gtk2::TreeViewGridLines o 'none' / 'GTK_TREE_VIEW_GRID_LINES_NONE' o 'horizontal' / 'GTK_TREE_VIEW_GRID_LINES_HORIZONTAL' o 'vertical' / 'GTK_TREE_VIEW_GRID_LINES_VERTICAL' o 'both' / 'GTK_TREE_VIEW_GRID_LINES_BOTH' SEE ALSO Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container COPYRIGHT Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.38.0 2023-07-25 Gtk2::TreeView(3)