1Gtk2::TreeView(3)     User Contributed Perl Documentation    Gtk2::TreeView(3)
2
3
4

NAME

6       Gtk2::TreeView - wrapper for GtkTreeView
7

HIERARCHY

9         Glib::Object
10         +----Glib::InitiallyUnowned
11              +----Gtk2::Object
12                   +----Gtk2::Widget
13                        +----Gtk2::Container
14                             +----Gtk2::TreeView
15

INTERFACES

17         Glib::Object::_Unregistered::AtkImplementorIface
18         Gtk2::Buildable
19

METHODS

21   widget = Gtk2::TreeView->new ($model=undef)
22       ·   $model (Gtk2::TreeModel)
23
24   widget = Gtk2::TreeView->new_with_model ($model)
25       ·   $model (Gtk2::TreeModel)
26
27   integer = $tree_view->append_column ($column)
28       ·   $column (Gtk2::TreeViewColumn)
29
30   rectangle = $tree_view->get_background_area ($path, $column)
31       ·   $path (Gtk2::TreePath or undef)
32
33       ·   $column (Gtk2::TreeViewColumn or undef)
34
35   window = $tree_view->get_bin_window
36   rectangle = $tree_view->get_cell_area ($path, $column)
37       ·   $path (Gtk2::TreePath or undef)
38
39       ·   $column (Gtk2::TreeViewColumn or undef)
40
41   $tree_view->collapse_all
42   boolean = $tree_view->collapse_row ($path)
43       ·   $path (Gtk2::TreePath)
44
45   $tree_view->set_column_drag_function ($func, $data=undef)
46       ·   $func (scalar)
47
48       ·   $data (scalar)
49
50   treeviewcolumn = $tree_view->get_column ($n)
51       ·   $n (integer)
52
53   $tree_view->columns_autosize
54   list = $tree_view->get_columns
55       Returns an array of columns.
56
57   (tx, ty) = $tree_view->convert_bin_window_to_tree_coords ($bx, $by)
58       ·   $bx (integer)
59
60       ·   $by (integer)
61
62       Since: gtk+ 2.12
63
64   (wx, wy) = $tree_view->convert_bin_window_to_widget_coords ($bx, $by)
65       ·   $bx (integer)
66
67       ·   $by (integer)
68
69       Since: gtk+ 2.12
70
71   (bx, by) = $tree_view->convert_tree_to_bin_window_coords ($tx, $ty)
72       ·   $tx (integer)
73
74       ·   $ty (integer)
75
76       Since: gtk+ 2.12
77
78   (wx, wy) = $tree_view->convert_tree_to_widget_coords ($tx, $ty)
79       ·   $tx (integer)
80
81       ·   $ty (integer)
82
83       Since: gtk+ 2.12
84
85   (bx, by) = $tree_view->convert_widget_to_bin_window_coords ($wx, $wy)
86       ·   $wx (integer)
87
88       ·   $wy (integer)
89
90       Since: gtk+ 2.12
91
92   (tx, ty) = $tree_view->convert_widget_to_tree_coords ($wx, $wy)
93       ·   $wx (integer)
94
95       ·   $wy (integer)
96
97       Since: gtk+ 2.12
98
99   pixmap = $tree_view->create_row_drag_icon ($path)
100       ·   $path (Gtk2::TreePath)
101
102   (path, focus_column) = $tree_view->get_cursor
103       Returns the Gtk2::TreePath and Gtk2::TreeViewColumn of the cell with
104       the keyboard focus cursor.  Either may be undef.
105
106   $tree_view->set_cursor_on_cell ($path, $focus_column, $focus_cell,
107       $start_editing)
108       ·   $path (Gtk2::TreePath)
109
110       ·   $focus_column (Gtk2::TreeViewColumn or undef)
111
112       ·   $focus_cell (Gtk2::CellRenderer or undef)
113
114       ·   $start_editing (boolean)
115
116       Since: gtk+ 2.2
117
118   $tree_view->set_cursor ($path, $focus_column=undef, $start_editing=FALSE)
119       ·   $path (Gtk2::TreePath)
120
121       ·   $focus_column (Gtk2::TreeViewColumn or undef)
122
123       ·   $start_editing (boolean)
124
125   (path, dropposition) = $tree_view->get_dest_row_at_pos ($drag_x, $drag_y)
126       ·   $drag_x (integer)
127
128       ·   $drag_y (integer)
129
130   (path, dropposition) = $tree_view->get_drag_dest_row
131   $tree_view->set_drag_dest_row ($path, $pos)
132       ·   $path (Gtk2::TreePath or undef)
133
134       ·   $pos (Gtk2::TreeViewDropPosition)
135
136   $tree_view->enable_model_drag_dest ($actions, ...)
137       ·   $actions (Gtk2::Gdk::DragAction)
138
139       ·   ... (list) of Gtk2::TargetEntry's
140
141   $tree_view->enable_model_drag_source ($start_button_mask, $actions, ...)
142       ·   $start_button_mask (Gtk2::Gdk::ModifierType)
143
144       ·   $actions (Gtk2::Gdk::DragAction)
145
146       ·   ... (list) of Gtk2::TargetEntry's
147
148   boolean = $tree_view->get_enable_search
149   $tree_view->set_enable_search ($enable_search)
150       ·   $enable_search (boolean)
151
152   boolean = $tree_view->get_enable_tree_lines
153       Since: gtk+ 2.10
154
155   $tree_view->set_enable_tree_lines ($enabled)
156       ·   $enabled (boolean)
157
158       Since: gtk+ 2.10
159
160   $tree_view->expand_all
161   boolean = $tree_view->expand_row ($path, $open_all)
162       ·   $path (Gtk2::TreePath)
163
164       ·   $open_all (boolean)
165
166   $tree_view->expand_to_path ($path)
167       ·   $path (Gtk2::TreePath)
168
169       Since: gtk+ 2.2
170
171   treeviewcolumn or undef = $tree_view->get_expander_column
172   $tree_view->set_expander_column ($column)
173       ·   $column (Gtk2::TreeViewColumn or undef)
174
175   boolean = $treeview->get_fixed_height_mode
176       Since: gtk+ 2.6
177
178   $treeview->set_fixed_height_mode ($enable)
179       ·   $enable (boolean)
180
181       Since: gtk+ 2.6
182
183   treeviewgridlines = $tree_view->get_grid_lines
184       Since: gtk+ 2.10
185
186   $tree_view->set_grid_lines ($grid_lines)
187       ·   $grid_lines (Gtk2::TreeViewGridLines)
188
189       Since: gtk+ 2.10
190
191   adjustment or undef = $tree_view->get_hadjustment
192   $tree_view->set_hadjustment ($adjustment)
193       ·   $adjustment (Gtk2::Adjustment or undef)
194
195   boolean = $tree_view->get_headers_clickable
196       Since: gtk+ 2.10
197
198   $tree_view->set_headers_clickable ($setting)
199       ·   $setting (boolean)
200
201   boolean = $tree_view->get_headers_visible
202   $tree_view->set_headers_visible ($headers_visible)
203       ·   $headers_visible (boolean)
204
205   boolean = $treeview->get_hover_expand
206       Since: gtk+ 2.6
207
208   $treeview->set_hover_expand ($expand)
209       ·   $expand (boolean)
210
211       Since: gtk+ 2.6
212
213   boolean = $treeview->get_hover_selection
214       Since: gtk+ 2.6
215
216   $treeview->set_hover_selection ($hover)
217       ·   $hover (boolean)
218
219       Since: gtk+ 2.6
220
221   integer = $tree_view->insert_column ($column, $position)
222       ·   $column (Gtk2::TreeViewColumn)
223
224       ·   $position (integer)
225
226   $tree_view->insert_column_with_attributes ($position, $title,
227       $cellrenderer, $attr1, $col1, $attr2, $col2, ...)
228       ·   $position (integer)
229
230       ·   $title (string)
231
232       ·   $cell (Gtk2::CellRenderer)
233
234       ·   ... (list)
235
236   integer = $tree_view->insert_column_with_data_func ($position, $title,
237       $cell, $func, $data=undef)
238       ·   $position (integer)
239
240       ·   $title (string)
241
242       ·   $cell (Gtk2::CellRenderer)
243
244       ·   $func (subroutine)
245
246       ·   $data (scalar)
247
248       Insert a column that calls $func every time it needs to fetch the data
249       for a cell.  $func will get a cell renderer, the tree model, and the
250       iter of the row in question, and should set the proper value into the
251       cell renderer.
252
253   boolean = $tree_view->is_rubber_banding_active
254       Since: gtk+ 2.12
255
256   integer = $tree_view->get_level_indentation
257       Since: gtk+ 2.12
258
259   $tree_view->set_level_indentation ($indentation)
260       ·   $indentation (integer)
261
262       Since: gtk+ 2.12
263
264   $tree_view->map_expanded_rows ($func, $data=undef)
265       ·   $func (scalar)
266
267       ·   $data (scalar)
268
269   treemodel or undef = $tree_view->get_model
270   $tree_view->set_model ($model)
271       ·   $model (Gtk2::TreeModel or undef)
272
273   $tree_view->move_column_after ($column, $base_column)
274       ·   $column (Gtk2::TreeViewColumn)
275
276       ·   $base_column (Gtk2::TreeViewColumn or undef)
277
278   path = $tree_view->get_path_at_pos ($x, $y)
279   (path, column, cell_x, cell_y) = $tree_view->get_path_at_pos ($x, $y)
280       ·   $x (integer)
281
282       ·   $y (integer)
283
284       Finds the path at the point ($x, $y), relative to widget coordinates.
285       That is, $x and $y are relative to an event's coordinates. $x and $y
286       must come from an event on the $tree_view only where "$event->window ==
287       $tree_view->get_bin_window". It is primarily for things like popup
288       menus.  In scalar context, returns the Gtk2::TreePath, in array
289       context, adds the Gtk2::TreeViewColumn, and $x and $y translated to be
290       relative to the cell.  This function is only meaningful if $tree_view
291       is realized.
292
293   integer = $tree_view->remove_column ($column)
294       ·   $column (Gtk2::TreeViewColumn)
295
296   boolean = $tree_view->get_reorderable
297   $tree_view->set_reorderable ($reorderable)
298       ·   $reorderable (boolean)
299
300   $tree_view->row_activated ($path, $column)
301       ·   $path (Gtk2::TreePath)
302
303       ·   $column (Gtk2::TreeViewColumn)
304
305   boolean = $tree_view->row_expanded ($path)
306       ·   $path (Gtk2::TreePath)
307
308   $tree_view->set_row_separator_func ($func, $data=undef)
309       ·   $func (scalar)
310
311       ·   $data (scalar)
312
313       Since: gtk+ 2.6
314
315   boolean = $tree_view->get_rubber_banding
316       Since: gtk+ 2.10
317
318   $tree_view->set_rubber_banding ($enable)
319       ·   $enable (boolean)
320
321       Since: gtk+ 2.10
322
323   boolean = $tree_view->get_rules_hint
324   $tree_view->set_rules_hint ($setting)
325       ·   $setting (boolean)
326
327   $tree_view->scroll_to_cell ($path, $column=undef, $use_align=FALSE,
328       $row_align=0.0, $col_align=0.0)
329       ·   $path (Gtk2::TreePath or undef)
330
331       ·   $column (Gtk2::TreeViewColumn or undef)
332
333       ·   $use_align (boolean)
334
335       ·   $row_align (double)
336
337       ·   $col_align (double)
338
339   $tree_view->scroll_to_point ($tree_x, $tree_y)
340       ·   $tree_x (scalar)
341
342       ·   $tree_y (scalar)
343
344   integer = $tree_view->get_search_column
345   $tree_view->set_search_column ($column)
346       ·   $column (integer)
347
348   entry or undef = $tree_view->get_search_entry
349       Since: gtk+ 2.10
350
351   $tree_view->set_search_entry ($entry)
352       ·   $entry (Gtk2::Entry or undef)
353
354       Since: gtk+ 2.10
355
356   $tree_view->set_search_equal_func ($func, $data=undef)
357       ·   $func (subroutine)
358
359       ·   $data (scalar)
360
361   $tree_view->set_search_position_func ($func, $user_data=undef)
362       ·   $func (scalar)
363
364       ·   $user_data (scalar)
365
366       Pass undef for the func to restore the default search position
367       function.
368
369       Since: gtk+ 2.10
370
371   treeselection = $tree_view->get_selection
372   boolean = $tree_view->get_show_expanders
373       Since: gtk+ 2.12
374
375   $tree_view->set_show_expanders ($enabled)
376       ·   $enabled (boolean)
377
378       Since: gtk+ 2.12
379
380   $tree_view->set_tooltip_cell ($tooltip, $path, $column, $cell)
381       ·   $tooltip (Gtk2::Tooltip)
382
383       ·   $path (Gtk2::TreePath)
384
385       ·   $column (Gtk2::TreeViewColumn)
386
387       ·   $cell (Gtk2::CellRenderer)
388
389       Since: gtk+ 2.12
390
391   integer = $tree_view->get_tooltip_column
392       Since: gtk+ 2.12
393
394   $tree_view->set_tooltip_column ($column)
395       ·   $column (integer)
396
397       Since: gtk+ 2.12
398
399   (x, y, model, path, iter) = $treeview->get_tooltip_context ($x, $y,
400       $keyboard_tip)
401       ·   $x (integer)
402
403       ·   $y (integer)
404
405       ·   $keyboard_tip (boolean)
406
407       Since: gtk+ 2.12
408
409   $tree_view->set_tooltip_row ($tooltip, $path)
410       ·   $tooltip (Gtk2::Tooltip)
411
412       ·   $path (Gtk2::TreePath)
413
414       Since: gtk+ 2.12
415
416   (wx, wy) = $tree_view->tree_to_widget_coords ($tx, $ty)
417       ·   $tx (integer)
418
419       ·   $ty (integer)
420
421   $tree_view->unset_rows_drag_dest
422   $tree_view->unset_rows_drag_source
423   adjustment or undef = $tree_view->get_vadjustment
424   $tree_view->set_vadjustment ($adjustment)
425       ·   $adjustment (Gtk2::Adjustment or undef)
426
427   (start_path, end_path) = $tree_view->get_visible_range
428       Since: gtk+ 2.8
429
430   rectangle = $tree_view->get_visible_rect
431   (tx, ty) = $tree_view->widget_to_tree_coords ($wx, $wy)
432       ·   $wx (integer)
433
434       ·   $wy (integer)
435

PROPERTIES

437       'enable-grid-lines' (Gtk2::TreeViewGridLines : default "none" :
438       readable / writable / private)
439           Whether grid lines should be drawn in the tree view
440
441       'enable-search' (boolean : default true : readable / writable /
442       private)
443           View allows user to search through columns interactively
444
445       'enable-tree-lines' (boolean : default false : readable / writable /
446       private)
447           Whether tree lines should be drawn in the tree view
448
449       'expander-column' (Gtk2::TreeViewColumn : default undef : readable /
450       writable / private)
451           Set the column for the expander column
452
453       'fixed-height-mode' (boolean : default false : readable / writable /
454       private)
455           Speeds up GtkTreeView by assuming that all rows have the same
456           height
457
458       'hadjustment' (Gtk2::Adjustment : default undef : readable / writable /
459       private)
460           Horizontal Adjustment for the widget
461
462       'headers-clickable' (boolean : default true : readable / writable /
463       private)
464           Column headers respond to click events
465
466       'headers-visible' (boolean : default true : readable / writable /
467       private)
468           Show the column header buttons
469
470       'hover-expand' (boolean : default false : readable / writable /
471       private)
472           Whether rows should be expanded/collapsed when the pointer moves
473           over them
474
475       'hover-selection' (boolean : default false : readable / writable /
476       private)
477           Whether the selection should follow the pointer
478
479       'level-indentation' (integer : default 0 : readable / writable /
480       private)
481           Extra indentation for each level
482
483       'model' (Gtk2::TreeModel : default undef : readable / writable /
484       private)
485           The model for the tree view
486
487       'reorderable' (boolean : default false : readable / writable / private)
488           View is reorderable
489
490       'rubber-banding' (boolean : default false : readable / writable /
491       private)
492           Whether to enable selection of multiple items by dragging the mouse
493           pointer
494
495       'rules-hint' (boolean : default false : readable / writable / private)
496           Set a hint to the theme engine to draw rows in alternating colors
497
498       'search-column' (integer : default -1 : readable / writable / private)
499           Model column to search through during interactive search
500
501       'show-expanders' (boolean : default true : readable / writable /
502       private)
503           View has expanders
504
505       'tooltip-column' (integer : default -1 : readable / writable / private)
506           The column in the model containing the tooltip texts for the rows
507
508       'vadjustment' (Gtk2::Adjustment : default undef : readable / writable /
509       private)
510           Vertical Adjustment for the widget
511

STYLE PROPERTIES

513       'allow-rules' (boolean : default true : readable / private)
514           Allow drawing of alternating color rows
515
516       'even-row-color' (Gtk2::Gdk::Color : default undef : readable /
517       private)
518           Color to use for even rows
519
520       'expander-size' (integer : default 12 : readable / private)
521           Size of the expander arrow
522
523       'grid-line-pattern' (string : default "\1\1" : readable / private)
524           Dash pattern used to draw the tree view grid lines
525
526       'grid-line-width' (integer : default 1 : readable / private)
527           Width, in pixels, of the tree view grid lines
528
529       'horizontal-separator' (integer : default 2 : readable / private)
530           Horizontal space between cells.  Must be an even number
531
532       'indent-expanders' (boolean : default true : readable / private)
533           Make the expanders indented
534
535       'odd-row-color' (Gtk2::Gdk::Color : default undef : readable / private)
536           Color to use for odd rows
537
538       'row-ending-details' (boolean : default false : readable / private)
539           Enable extended row background theming
540
541       'tree-line-pattern' (string : default "\1\1" : readable / private)
542           Dash pattern used to draw the tree view lines
543
544       'tree-line-width' (integer : default 1 : readable / private)
545           Width, in pixels, of the tree view lines
546
547       'vertical-separator' (integer : default 2 : readable / private)
548           Vertical space between cells.  Must be an even number
549

SIGNALS

551       columns-changed (Gtk2::TreeView)
552       cursor-changed (Gtk2::TreeView)
553       boolean = expand-collapse-cursor-row (Gtk2::TreeView, boolean, boolean,
554       boolean)
555       boolean = move-cursor (Gtk2::TreeView, Gtk2::MovementStep, integer)
556       row-activated (Gtk2::TreeView, Gtk2::TreePath, Gtk2::TreeViewColumn)
557       row-collapsed (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath)
558       row-expanded (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath)
559       boolean = select-all (Gtk2::TreeView)
560       boolean = select-cursor-parent (Gtk2::TreeView)
561       boolean = select-cursor-row (Gtk2::TreeView, boolean)
562       set-scroll-adjustments (Gtk2::TreeView, Gtk2::Adjustment,
563       Gtk2::Adjustment)
564       boolean = start-interactive-search (Gtk2::TreeView)
565       boolean = test-collapse-row (Gtk2::TreeView, Gtk2::TreeIter,
566       Gtk2::TreePath)
567       boolean = test-expand-row (Gtk2::TreeView, Gtk2::TreeIter,
568       Gtk2::TreePath)
569       boolean = toggle-cursor-row (Gtk2::TreeView)
570       boolean = unselect-all (Gtk2::TreeView)
571

ENUMS AND FLAGS

573   flags Gtk2::Gdk::DragAction
574       ·   'default' / 'GDK_ACTION_DEFAULT'
575
576       ·   'copy' / 'GDK_ACTION_COPY'
577
578       ·   'move' / 'GDK_ACTION_MOVE'
579
580       ·   'link' / 'GDK_ACTION_LINK'
581
582       ·   'private' / 'GDK_ACTION_PRIVATE'
583
584       ·   'ask' / 'GDK_ACTION_ASK'
585
586   flags Gtk2::Gdk::ModifierType
587       ·   'shift-mask' / 'GDK_SHIFT_MASK'
588
589       ·   'lock-mask' / 'GDK_LOCK_MASK'
590
591       ·   'control-mask' / 'GDK_CONTROL_MASK'
592
593       ·   'mod1-mask' / 'GDK_MOD1_MASK'
594
595       ·   'mod2-mask' / 'GDK_MOD2_MASK'
596
597       ·   'mod3-mask' / 'GDK_MOD3_MASK'
598
599       ·   'mod4-mask' / 'GDK_MOD4_MASK'
600
601       ·   'mod5-mask' / 'GDK_MOD5_MASK'
602
603       ·   'button1-mask' / 'GDK_BUTTON1_MASK'
604
605       ·   'button2-mask' / 'GDK_BUTTON2_MASK'
606
607       ·   'button3-mask' / 'GDK_BUTTON3_MASK'
608
609       ·   'button4-mask' / 'GDK_BUTTON4_MASK'
610
611       ·   'button5-mask' / 'GDK_BUTTON5_MASK'
612
613       ·   'super-mask' / 'GDK_SUPER_MASK'
614
615       ·   'hyper-mask' / 'GDK_HYPER_MASK'
616
617       ·   'meta-mask' / 'GDK_META_MASK'
618
619       ·   'release-mask' / 'GDK_RELEASE_MASK'
620
621       ·   'modifier-mask' / 'GDK_MODIFIER_MASK'
622
623   enum Gtk2::MovementStep
624       ·   'logical-positions' / 'GTK_MOVEMENT_LOGICAL_POSITIONS'
625
626       ·   'visual-positions' / 'GTK_MOVEMENT_VISUAL_POSITIONS'
627
628       ·   'words' / 'GTK_MOVEMENT_WORDS'
629
630       ·   'display-lines' / 'GTK_MOVEMENT_DISPLAY_LINES'
631
632       ·   'display-line-ends' / 'GTK_MOVEMENT_DISPLAY_LINE_ENDS'
633
634       ·   'paragraphs' / 'GTK_MOVEMENT_PARAGRAPHS'
635
636       ·   'paragraph-ends' / 'GTK_MOVEMENT_PARAGRAPH_ENDS'
637
638       ·   'pages' / 'GTK_MOVEMENT_PAGES'
639
640       ·   'buffer-ends' / 'GTK_MOVEMENT_BUFFER_ENDS'
641
642       ·   'horizontal-pages' / 'GTK_MOVEMENT_HORIZONTAL_PAGES'
643
644   enum Gtk2::TreeViewDropPosition
645       ·   'before' / 'GTK_TREE_VIEW_DROP_BEFORE'
646
647       ·   'after' / 'GTK_TREE_VIEW_DROP_AFTER'
648
649       ·   'into-or-before' / 'GTK_TREE_VIEW_DROP_INTO_OR_BEFORE'
650
651       ·   'into-or-after' / 'GTK_TREE_VIEW_DROP_INTO_OR_AFTER'
652
653   enum Gtk2::TreeViewGridLines
654       ·   'none' / 'GTK_TREE_VIEW_GRID_LINES_NONE'
655
656       ·   'horizontal' / 'GTK_TREE_VIEW_GRID_LINES_HORIZONTAL'
657
658       ·   'vertical' / 'GTK_TREE_VIEW_GRID_LINES_VERTICAL'
659
660       ·   'both' / 'GTK_TREE_VIEW_GRID_LINES_BOTH'
661

SEE ALSO

663       Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
664       Gtk2::Container
665
667       Copyright (C) 2003-2011 by the gtk2-perl team.
668
669       This software is licensed under the LGPL.  See Gtk2 for a full notice.
670
671
672
673perl v5.28.0                      2018-07-18                 Gtk2::TreeView(3)
Impressum