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

METHODS

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

PROPERTIES

346       'enable-grid-lines' (Gtk2::TreeViewGridLines : readable / writable /
347       private)
348           Whether grid lines should be drawn in the tree view
349
350       'enable-search' (boolean : readable / writable / private)
351           View allows user to search through columns interactively
352
353       'enable-tree-lines' (boolean : readable / writable / private)
354           Whether tree lines should be drawn in the tree view
355
356       'expander-column' (Gtk2::TreeViewColumn : readable / writable / pri‐
357       vate)
358           Set the column for the expander column
359
360       'fixed-height-mode' (boolean : readable / writable / private)
361           Speeds up GtkTreeView by assuming that all rows have the same
362           height
363
364       'hadjustment' (Gtk2::Adjustment : readable / writable / private)
365           Horizontal Adjustment for the widget
366
367       'headers-clickable' (boolean : readable / writable / private)
368           Column headers respond to click events
369
370       'headers-visible' (boolean : readable / writable / private)
371           Show the column header buttons
372
373       'hover-expand' (boolean : readable / writable / private)
374           Whether rows should be expanded/collapsed when the pointer moves
375           over them
376
377       'hover-selection' (boolean : readable / writable / private)
378           Whether the selection should follow the pointer
379
380       'level-indentation' (integer : readable / writable / private)
381           Extra indentation for each level
382
383       'model' (Gtk2::TreeModel : readable / writable / private)
384           The model for the tree view
385
386       'reorderable' (boolean : readable / writable / private)
387           View is reorderable
388
389       'rubber-banding' (boolean : readable / writable / private)
390           Whether to enable selection of multiple items by dragging the mouse
391           pointer
392
393       'rules-hint' (boolean : readable / writable / private)
394           Set a hint to the theme engine to draw rows in alternating colors
395
396       'search-column' (integer : readable / writable / private)
397           Model column to search through when searching through code
398
399       'show-expanders' (boolean : readable / writable / private)
400           View has expanders
401
402       'vadjustment' (Gtk2::Adjustment : readable / writable / private)
403           Vertical Adjustment for the widget
404

SIGNALS

406       set-scroll-adjustments (Gtk2::TreeView, Gtk2::Adjustment, Gtk2::Adjust‐
407       ment)
408       boolean = select-all (Gtk2::TreeView)
409       boolean = unselect-all (Gtk2::TreeView)
410       boolean = move-cursor (Gtk2::TreeView, Gtk2::MovementStep, integer)
411       row-activated (Gtk2::TreeView, Gtk2::TreePath, Gtk2::TreeViewColumn)
412       boolean = test-expand-row (Gtk2::TreeView, Gtk2::TreeIter,
413       Gtk2::TreePath)
414       boolean = test-collapse-row (Gtk2::TreeView, Gtk2::TreeIter,
415       Gtk2::TreePath)
416       row-expanded (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath)
417       row-collapsed (Gtk2::TreeView, Gtk2::TreeIter, Gtk2::TreePath)
418       columns-changed (Gtk2::TreeView)
419       cursor-changed (Gtk2::TreeView)
420       boolean = select-cursor-row (Gtk2::TreeView, boolean)
421       boolean = toggle-cursor-row (Gtk2::TreeView)
422       boolean = expand-collapse-cursor-row (Gtk2::TreeView, boolean, boolean,
423       boolean)
424       boolean = select-cursor-parent (Gtk2::TreeView)
425       boolean = start-interactive-search (Gtk2::TreeView)
426

ENUMS AND FLAGS

428       flags Gtk2::Gdk::DragAction
429
430       * 'default' / 'GDK_ACTION_DEFAULT'
431       * 'copy' / 'GDK_ACTION_COPY'
432       * 'move' / 'GDK_ACTION_MOVE'
433       * 'link' / 'GDK_ACTION_LINK'
434       * 'private' / 'GDK_ACTION_PRIVATE'
435       * 'ask' / 'GDK_ACTION_ASK'
436
437       flags Gtk2::Gdk::ModifierType
438
439       * 'shift-mask' / 'GDK_SHIFT_MASK'
440       * 'lock-mask' / 'GDK_LOCK_MASK'
441       * 'control-mask' / 'GDK_CONTROL_MASK'
442       * 'mod1-mask' / 'GDK_MOD1_MASK'
443       * 'mod2-mask' / 'GDK_MOD2_MASK'
444       * 'mod3-mask' / 'GDK_MOD3_MASK'
445       * 'mod4-mask' / 'GDK_MOD4_MASK'
446       * 'mod5-mask' / 'GDK_MOD5_MASK'
447       * 'button1-mask' / 'GDK_BUTTON1_MASK'
448       * 'button2-mask' / 'GDK_BUTTON2_MASK'
449       * 'button3-mask' / 'GDK_BUTTON3_MASK'
450       * 'button4-mask' / 'GDK_BUTTON4_MASK'
451       * 'button5-mask' / 'GDK_BUTTON5_MASK'
452       * 'super-mask' / 'GDK_SUPER_MASK'
453       * 'hyper-mask' / 'GDK_HYPER_MASK'
454       * 'meta-mask' / 'GDK_META_MASK'
455       * 'release-mask' / 'GDK_RELEASE_MASK'
456       * 'modifier-mask' / 'GDK_MODIFIER_MASK'
457
458       enum Gtk2::MovementStep
459
460       * 'logical-positions' / 'GTK_MOVEMENT_LOGICAL_POSITIONS'
461       * 'visual-positions' / 'GTK_MOVEMENT_VISUAL_POSITIONS'
462       * 'words' / 'GTK_MOVEMENT_WORDS'
463       * 'display-lines' / 'GTK_MOVEMENT_DISPLAY_LINES'
464       * 'display-line-ends' / 'GTK_MOVEMENT_DISPLAY_LINE_ENDS'
465       * 'paragraphs' / 'GTK_MOVEMENT_PARAGRAPHS'
466       * 'paragraph-ends' / 'GTK_MOVEMENT_PARAGRAPH_ENDS'
467       * 'pages' / 'GTK_MOVEMENT_PAGES'
468       * 'buffer-ends' / 'GTK_MOVEMENT_BUFFER_ENDS'
469       * 'horizontal-pages' / 'GTK_MOVEMENT_HORIZONTAL_PAGES'
470
471       enum Gtk2::TreeViewDropPosition
472
473       * 'before' / 'GTK_TREE_VIEW_DROP_BEFORE'
474       * 'after' / 'GTK_TREE_VIEW_DROP_AFTER'
475       * 'into-or-before' / 'GTK_TREE_VIEW_DROP_INTO_OR_BEFORE'
476       * 'into-or-after' / 'GTK_TREE_VIEW_DROP_INTO_OR_AFTER'
477
478       enum Gtk2::TreeViewGridLines
479
480       * 'none' / 'GTK_TREE_VIEW_GRID_LINES_NONE'
481       * 'horizontal' / 'GTK_TREE_VIEW_GRID_LINES_HORIZONTAL'
482       * 'vertical' / 'GTK_TREE_VIEW_GRID_LINES_VERTICAL'
483       * 'both' / 'GTK_TREE_VIEW_GRID_LINES_BOTH'
484

SEE ALSO

486       Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
487       Gtk2::Container
488
490       Copyright (C) 2003-2007 by the gtk2-perl team.
491
492       This software is licensed under the LGPL.  See Gtk2 for a full notice.
493
494
495
496perl v5.8.8                       2007-03-18                 Gtk2::TreeView(3)
Impressum