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

NAME

6       Gtk2::TreeView
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           Retuns 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
104           with 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
249           data for a cell.  $func will get a cell renderer, the tree model,
250           and the iter of the row in question, and should set the proper
251           value into the 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
285           coordinates. That is, $x and $y are relative to an event's
286           coordinates. $x and $y must come from an event on the $tree_view
287           only where "$event->window == $tree_view->get_bin_window". It is
288           primarily for things like popup menus.  In scalar context, returns
289           the Gtk2::TreePath, in array context, adds the
290           Gtk2::TreeViewColumn, and $x and $y translated to be relative to
291           the cell.  This function is only meaningful if $tree_view is
292           realized.
293
294   integer = $tree_view->remove_column ($column)
295           ·   $column (Gtk2::TreeViewColumn)
296
297   boolean = $tree_view->get_reorderable
298   $tree_view->set_reorderable ($reorderable)
299           ·   $reorderable (boolean)
300
301   $tree_view->row_activated ($path, $column)
302           ·   $path (Gtk2::TreePath)
303
304           ·   $column (Gtk2::TreeViewColumn)
305
306   boolean = $tree_view->row_expanded ($path)
307           ·   $path (Gtk2::TreePath)
308
309   $tree_view->set_row_separator_func ($func, $data=undef)
310           ·   $func (scalar)
311
312           ·   $data (scalar)
313
314           Since: gtk+ 2.6
315
316   boolean = $tree_view->get_rubber_banding
317           Since: gtk+ 2.10
318
319   $tree_view->set_rubber_banding ($enable)
320           ·   $enable (boolean)
321
322           Since: gtk+ 2.10
323
324   boolean = $tree_view->get_rules_hint
325   $tree_view->set_rules_hint ($setting)
326           ·   $setting (boolean)
327
328   $tree_view->scroll_to_cell ($path, $column=undef, $use_align=FALSE,
329       $row_align=0.0, $col_align=0.0)
330           ·   $path (Gtk2::TreePath or undef)
331
332           ·   $column (Gtk2::TreeViewColumn or undef)
333
334           ·   $use_align (boolean)
335
336           ·   $row_align (double)
337
338           ·   $col_align (double)
339
340   $tree_view->scroll_to_point ($tree_x, $tree_y)
341           ·   $tree_x (scalar)
342
343           ·   $tree_y (scalar)
344
345   integer = $tree_view->get_search_column
346   $tree_view->set_search_column ($column)
347           ·   $column (integer)
348
349   entry or undef = $tree_view->get_search_entry
350           Since: gtk+ 2.10
351
352   $tree_view->set_search_entry ($entry)
353           ·   $entry (Gtk2::Entry or undef)
354
355           Since: gtk+ 2.10
356
357   $tree_view->set_search_equal_func ($func, $data=undef)
358           ·   $func (subroutine)
359
360           ·   $data (scalar)
361
362   $tree_view->set_search_position_func ($func, $user_data=undef)
363           ·   $func (scalar)
364
365           ·   $user_data (scalar)
366
367           Pass undef for the func to restore the default search position
368           function.
369
370           Since: gtk+ 2.10
371
372   treeselection = $tree_view->get_selection
373   boolean = $tree_view->get_show_expanders
374           Since: gtk+ 2.12
375
376   $tree_view->set_show_expanders ($enabled)
377           ·   $enabled (boolean)
378
379           Since: gtk+ 2.12
380
381   $tree_view->set_tooltip_cell ($tooltip, $path, $column, $cell)
382           ·   $tooltip (Gtk2::Tooltip)
383
384           ·   $path (Gtk2::TreePath)
385
386           ·   $column (Gtk2::TreeViewColumn)
387
388           ·   $cell (Gtk2::CellRenderer)
389
390           Since: gtk+ 2.12
391
392   integer = $tree_view->get_tooltip_column
393           Since: gtk+ 2.12
394
395   $tree_view->set_tooltip_column ($column)
396           ·   $column (integer)
397
398           Since: gtk+ 2.12
399
400   (x, y, model, path, iter) = $treeview->get_tooltip_context ($x, $y,
401       $keyboard_tip)
402           ·   $x (integer)
403
404           ·   $y (integer)
405
406           ·   $keyboard_tip (boolean)
407
408           Since: gtk+ 2.12
409
410   $tree_view->set_tooltip_row ($tooltip, $path)
411           ·   $tooltip (Gtk2::Tooltip)
412
413           ·   $path (Gtk2::TreePath)
414
415           Since: gtk+ 2.12
416
417   (wx, wy) = $tree_view->tree_to_widget_coords ($tx, $ty)
418           ·   $tx (integer)
419
420           ·   $ty (integer)
421
422   $tree_view->unset_rows_drag_dest
423   $tree_view->unset_rows_drag_source
424   adjustment or undef = $tree_view->get_vadjustment
425   $tree_view->set_vadjustment ($adjustment)
426           ·   $adjustment (Gtk2::Adjustment or undef)
427
428   (start_path, end_path) = $tree_view->get_visible_range
429           Since: gtk+ 2.8
430
431   rectangle = $tree_view->get_visible_rect
432   (tx, ty) = $tree_view->widget_to_tree_coords ($wx, $wy)
433           ·   $wx (integer)
434
435           ·   $wy (integer)
436

PROPERTIES

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

SIGNALS

501       set-scroll-adjustments (Gtk2::TreeView, Gtk2::Adjustment,
502       Gtk2::Adjustment)
503       boolean = select-all (Gtk2::TreeView)
504       boolean = unselect-all (Gtk2::TreeView)
505       boolean = move-cursor (Gtk2::TreeView, Gtk2::MovementStep, integer)
506       row-activated (Gtk2::TreeView, Gtk2::TreePath, Gtk2::TreeViewColumn)
507       boolean = test-expand-row (Gtk2::TreeView, Gtk2::TreeIter,
508       Gtk2::TreePath)
509       boolean = test-collapse-row (Gtk2::TreeView, Gtk2::TreeIter,
510       Gtk2::TreePath)
511       row-expanded (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath)
512       row-collapsed (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath)
513       columns-changed (Gtk2::TreeView)
514       cursor-changed (Gtk2::TreeView)
515       boolean = select-cursor-row (Gtk2::TreeView, boolean)
516       boolean = toggle-cursor-row (Gtk2::TreeView)
517       boolean = expand-collapse-cursor-row (Gtk2::TreeView, boolean, boolean,
518       boolean)
519       boolean = select-cursor-parent (Gtk2::TreeView)
520       boolean = start-interactive-search (Gtk2::TreeView)
521

ENUMS AND FLAGS

523   flags Gtk2::Gdk::DragAction
524       ·   'default' / 'GDK_ACTION_DEFAULT'
525
526       ·   'copy' / 'GDK_ACTION_COPY'
527
528       ·   'move' / 'GDK_ACTION_MOVE'
529
530       ·   'link' / 'GDK_ACTION_LINK'
531
532       ·   'private' / 'GDK_ACTION_PRIVATE'
533
534       ·   'ask' / 'GDK_ACTION_ASK'
535
536   flags Gtk2::Gdk::ModifierType
537       ·   'shift-mask' / 'GDK_SHIFT_MASK'
538
539       ·   'lock-mask' / 'GDK_LOCK_MASK'
540
541       ·   'control-mask' / 'GDK_CONTROL_MASK'
542
543       ·   'mod1-mask' / 'GDK_MOD1_MASK'
544
545       ·   'mod2-mask' / 'GDK_MOD2_MASK'
546
547       ·   'mod3-mask' / 'GDK_MOD3_MASK'
548
549       ·   'mod4-mask' / 'GDK_MOD4_MASK'
550
551       ·   'mod5-mask' / 'GDK_MOD5_MASK'
552
553       ·   'button1-mask' / 'GDK_BUTTON1_MASK'
554
555       ·   'button2-mask' / 'GDK_BUTTON2_MASK'
556
557       ·   'button3-mask' / 'GDK_BUTTON3_MASK'
558
559       ·   'button4-mask' / 'GDK_BUTTON4_MASK'
560
561       ·   'button5-mask' / 'GDK_BUTTON5_MASK'
562
563       ·   'super-mask' / 'GDK_SUPER_MASK'
564
565       ·   'hyper-mask' / 'GDK_HYPER_MASK'
566
567       ·   'meta-mask' / 'GDK_META_MASK'
568
569       ·   'release-mask' / 'GDK_RELEASE_MASK'
570
571       ·   'modifier-mask' / 'GDK_MODIFIER_MASK'
572
573   enum Gtk2::MovementStep
574       ·   'logical-positions' / 'GTK_MOVEMENT_LOGICAL_POSITIONS'
575
576       ·   'visual-positions' / 'GTK_MOVEMENT_VISUAL_POSITIONS'
577
578       ·   'words' / 'GTK_MOVEMENT_WORDS'
579
580       ·   'display-lines' / 'GTK_MOVEMENT_DISPLAY_LINES'
581
582       ·   'display-line-ends' / 'GTK_MOVEMENT_DISPLAY_LINE_ENDS'
583
584       ·   'paragraphs' / 'GTK_MOVEMENT_PARAGRAPHS'
585
586       ·   'paragraph-ends' / 'GTK_MOVEMENT_PARAGRAPH_ENDS'
587
588       ·   'pages' / 'GTK_MOVEMENT_PAGES'
589
590       ·   'buffer-ends' / 'GTK_MOVEMENT_BUFFER_ENDS'
591
592       ·   'horizontal-pages' / 'GTK_MOVEMENT_HORIZONTAL_PAGES'
593
594   enum Gtk2::TreeViewDropPosition
595       ·   'before' / 'GTK_TREE_VIEW_DROP_BEFORE'
596
597       ·   'after' / 'GTK_TREE_VIEW_DROP_AFTER'
598
599       ·   'into-or-before' / 'GTK_TREE_VIEW_DROP_INTO_OR_BEFORE'
600
601       ·   'into-or-after' / 'GTK_TREE_VIEW_DROP_INTO_OR_AFTER'
602
603   enum Gtk2::TreeViewGridLines
604       ·   'none' / 'GTK_TREE_VIEW_GRID_LINES_NONE'
605
606       ·   'horizontal' / 'GTK_TREE_VIEW_GRID_LINES_HORIZONTAL'
607
608       ·   'vertical' / 'GTK_TREE_VIEW_GRID_LINES_VERTICAL'
609
610       ·   'both' / 'GTK_TREE_VIEW_GRID_LINES_BOTH'
611

SEE ALSO

613       Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
614       Gtk2::Container
615
617       Copyright (C) 2003-2008 by the gtk2-perl team.
618
619       This software is licensed under the LGPL.  See Gtk2 for a full notice.
620
621
622
623perl v5.12.0                      2010-05-02                 Gtk2::TreeView(3)
Impressum