Package: gtk

Class gtk-tree-view

Superclasses

gtk-container, gtk-widget, g-initially-unowned, gtk-buildable, gtk-scrollable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

enable-grid-lines
The "enable-grid-lines" property of type gtk-tree-view-grid-lines (Read / Write)
Whether grid lines should be drawn in the tree view.
Default value: :none
enable-search
The "enable-search" property of type :boolean (Read / Write)
View allows user to search through columns interactively.
Default value: true
enable-tree-lines
The "enable-tree-lines" property of type :boolean (Read / Write)
Whether tree lines should be drawn in the tree view.
Default value: nil
expander-column
The "expander-column" property of type gtk-tree-view-column (Read / Write)
Set the column for the expander column.
fixed-height-mode
The "fixed-height-mode" property of type :boolean (Read / Write)
Setting the "fixed-height-mode" property to true speeds up gtk-tree-view by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see the function gtk-tree-view-set-fixed-height-mode for more information on this option.
Default value: nil
Since 2.4
headers-clickable
The "headers-clickable" property of type :boolean (Read / Write)
Column headers respond to click events.
Default value: true
headers-visible
The "headers-visible" property of type :boolean (Read / Write)
Show the column header buttons.
Default value: true
hover-expand
The "hover-expand" property of type :boolean (Read / Write)
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-combo-box or gtk-entry-completion.
Default value: nil
Since 2.6
hover-selection
The "hover-selection" property of type :boolean (Read / Write)
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 :single and :browse. This mode is primarily intended for treeviews in popups, e. g. in gtk-combo-box or gtk-entry-completion.
Default value: nil
Since 2.6
level-indentation
The "level-indentation" property of type :int (Read / Write)
Extra indentation for each level.
Allowed values: >= 0
Default value: 0
Since 2.12
model
The "model" property of type gtk-tree-model (Read / Write)
The model for the tree view.
reorderable
The "reorderable" property of type :boolean (Read / Write)
View is reorderable.
Default value: nil
rubber-banding
The "rubber-banding" property of type :boolean (Read / Write)
Whether to enable selection of multiple items by dragging the mouse pointer.
Default value: nil
rules-hint
The "rules-hint" property of type :boolean (Read / Write)
Set a hint to the theme engine to draw rows in alternating colors.
Default value: nil
search-column
The "search-column" property of type :int (Read / Write)
Model column to search through during interactive search.
Allowed values: >= G_MAXULONG
Default value: -1
show-expanders
The "show-expanders" property of type :boolean (Read / Write)
True if the view has expanders.
Default value: true
Since 2.12
tooltip-column
The "tooltip-column" property of type :int (Read / Write)
The column in the model containing the tooltip texts for the rows.
Allowed values: >= G_MAXULONG
Default value: -1

Details

Widget that displays any object that implements the gtk-tree-model interface.

Please refer to the tree widget conceptual overview for an overview of all the objects and data types related to the tree widget and how they work together.

Several different coordinate systems are exposed in the gtk-tree-view API. These are:
Coordinate systems in @sym{gtk-tree-view} API
Widget coordinates
Coordinates relative to the widget (usually widget->window).
Bin window coordinates
Coordinates relative to the window that gtk-tree-view renders to.
Tree coordinates
Coordinates relative to the entire scrollable area of gtk-tree-view. These coordinates start at (0, 0) for row 0 of the tree.
Several functions are available for converting between the different coordinate systems. The most common translations are between widget and bin window coordinates and between bin window and tree coordinates. For the former you can use the gtk-tree-view-convert-widget-to-bin-window-coords function (and vice versa), for the latter the gtk-tree-view-convert-bin-window-to-tree-coords function (and vice versa).

GtkTreeView as GtkBuildable
The gtk-tree-view implementation of the gtk-buildable interface accepts gtk-tree-view-column objects as <child> elements and exposes the internal gtk-tree-selection in UI definitions.

Example: A UI definition fragment with gtk-tree-view
   <object class="GtkTreeView" id="treeview">
     <property name="model">liststore1</property>
     <child>
       <object class="GtkTreeViewColumn" id="test-column">
         <property name="title">Test</property>
         <child>
           <object class="GtkCellRendererText" id="test-renderer"/>
           <attributes>
             <attribute name="text">1</attribute>
           </attributes>
         </child>
       </object>
     </child>
     <child internal-child="selection">
       <object class="GtkTreeSelection" id="selection">
         <signal name="changed" handler="on_treeview_selection_changed"/>
       </object>
     </child>
   </object>    

Style Property Details

The "allow-rules" style property
"allow-rules" of type :boolean (Read)
Allow drawing of alternating color rows.
Default value: true

The "even-row-color" style property
"even-row-color" of type gdk-color (Read)
Color to use for even rows.

The "expander-size" style property
"expander-size" of type :int (Read)
Size of the expander arrow.
Allowed values: >= 0
Default value: 14

The "grid-line-pattern" style property
"grid-line-pattern" of type :string (Read)
Dash pattern used to draw the tree view grid lines.
Default value: "001001"

The "grid-line-width" style property
"grid-line-width" of type :int (Read)
Width, in pixels, of the tree view grid lines.
Allowed values: >= 0
Default value: 1

The "horizontal-separator" style property
"horizontal-separator" of tpye :int (Read)
Horizontal space between cells. Must be an even number.
Allowed values: >= 0
Default value: 2

The "indent-expanders" style property
"indent-expanders" of type :boolean (Read)
Make the expanders indented.
Default value: true

The "odd-row-color" style property
"odd-row-color" of type gdk-color (Read)
Color to use for odd rows.

The "tree-line-pattern" style property
"tree-line-pattern" of type :string (Read)
Dash pattern used to draw the tree view lines.
Default value: "001001"

The "tree-line-width" style property
"tree-line-width" of type :int (Read)
Width, in pixels, of the tree view lines.
Allowed values: >= 0
Default value: 1

The "vertical-separator" style property
"vertical-separator" of type :int (Read)
Vertical space between cells. Must be an even number.
Allowed values: >= 0
Default value: 2

Signal Details

The "columns-changed" signal
 lambda (tree-view)   : Run Last      
The number of columns of the treeview has changed.
tree-view
The object on which the signal is emitted.
The "cursor-changed" signal
 lambda (tree-view)   : Run Last      
The position of the cursor (focused cell) has changed.
tree-view
The object on which the signal is emitted.
The "expand-collapse-cursor-row" signal
 lambda (treeview arg1 arg2 arg3)   : Action      
The "move-cursor" signal
 lambda (treeview arg1 arg2)   : Action      
The "row-activated" signal
 lambda (tree-view path column)      
The "row-activated" signal is emitted when the method gtk-tree-view-row-activated is called or the user double clicks a treeview row. It is also emitted when a non-editable row is selected and one of the keys: Space, Shift+Space, Return or Enter is pressed. For selection handling refer to the tree widget conceptual overview as well as gtk-tree-selection.
tree-view
The object on which the signal is emitted.
path
The gtk-tree-path for the activated row.
column
The gtk-tree-view-column in which the activation occurred
The "row-collapsed" signal
 lambda (tree-view iter path)   : Run Last      
The given row has been collapsed (child nodes are hidden).
tree-view
The object on which the signal is emitted.
iter
The tree iter of the collapsed row.
path
A tree path that points to the row.
The "row-expanded" signal
 lambda (tree-view iter path)   : Run Last      
The given row has been expanded (child nodes are shown).
tree-view
The object on which the signal is emitted.
iter
The tree iter of the expanded row.
path
A tree path that points to the row.
The "select-all" signal
 lambda (treeview)   : Action      
The "select-cursor-parent" signal
 lambda (treeview)   : Action      
The "select-cursor-row" signal
 lambda (treeview arg1)   : Action      
The "start-interactive-search" signal
 lambda (treeview)   : Action      
The "test-collapse-row" signal
 lambda (tree-view iter path)   : Run Last      
The given row is about to be collapsed (hide its children nodes). Use this signal if you need to control the collapsibility of individual rows.
tree-view
The object on which the signal is emitted.
iter
The tree iter of the row to collapsed.
path
A tree path that points to the row.
Returns
Nil to allow collapsing, true to reject.
The "test-expand-row" signal
 lambda (tree-view iter path)   : Run Last      
The given row is about to be expanded (show its children nodes). Use this signal if you need to control the expandability of individual rows.
tree-view
The object on which the signal is emitted.
iter
The tree iter of the row to expand.
path
A tree path that points to the row.
Returns
Nil to allow expansion, true to reject.
The "toggle-cursor-row" signal
 lambda (treeview)   : Action      
The "unselect-all" signal
 lambda (treeview)   : Action      
 

Slot Access Functions

Inherited Slot Access Functions

2013-12-29