2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkTreeView.html
49 * - gtk.TreeViewColumn
59 * - GdkPixmap* -> Pixmap
60 * - GdkRectangle* -> Rectangle
61 * - GdkWindow* -> Window
62 * - GtkAdjustment* -> Adjustment
63 * - GtkCellRenderer* -> CellRenderer
64 * - GtkTreeModel* -> TreeModel
65 * - GtkTreePath* -> TreePath
66 * - GtkTreeSelection* -> TreeSelection
67 * - GtkTreeViewColumn* -> TreeViewColumn
78 import tango
.io
.Stdout
; // use the tango loging?
82 private import gtkc
.gtktypes
;
84 private import gtkc
.gtk
;
87 private import glib
.Str
;
88 private import gtk
.TreeModel
;
89 private import gtk
.TreeSelection
;
90 private import gtk
.Adjustment
;
91 private import gtk
.TreeViewColumn
;
92 private import gtk
.CellRenderer
;
93 private import glib
.ListG
;
94 private import gtk
.TreePath
;
95 private import gdk
.Rectangle
;
96 private import gdk
.Window
;
97 private import gdk
.Pixmap
;
98 private import gtk
.TreeIter
;
105 * Widget that displays any object that implements the GtkTreeModel interface.
106 * Please refer to the tree widget conceptual overview
107 * for an overview of all the objects and data types related to the tree widget and how
108 * they work together.
110 private import gtk
.Container
;
111 public class TreeView
: Container
114 /** the main Gtk struct */
115 protected GtkTreeView
* gtkTreeView
;
118 public GtkTreeView
* getTreeViewStruct()
124 /** the main Gtk struct as a void* */
125 protected void* getStruct()
127 return cast(void*)gtkTreeView
;
131 * Sets our main struct and passes it to the parent class
133 public this (GtkTreeView
* gtkTreeView
)
137 if ( gtkTreeView
is null )
142 Stdout("struct gtkTreeView is null on constructor").newline
;
146 printf("struct gtkTreeView is null on constructor");
153 assert(gtkTreeView
!is null, "struct gtkTreeView is null on constructor");
155 super(cast(GtkContainer
*)gtkTreeView
);
156 this.gtkTreeView
= gtkTreeView
;
160 * Expands the row of the iter.
165 int expandRow(TreeIter iter
, TreeModel model
, int openAll
)
167 return expandRow(model
.getPath(iter
), openAll
);
171 * Finds the path at the point (x, y), relative to widget coordinates. That
172 * is, x and y are relative to an events coordinates. x and y must come
173 * from an event on the tree_view only where event->window ==
174 * gtk_tree_view_get_bin (). It is primarily for things
175 * like popup menus. If path is non-NULL, then it will be filled with the
176 * GtkTreePath at that point. This path should be freed with gtk_tree_path_free().
177 * If column is non-NULL, then it will be filled with the column at that point.
178 * cell_x and cell_y return the coordinates relative to the cell background
179 * (i.e. the background_area passed to gtk_cell_renderer_render()). This
180 * function is only meaningful if tree_view is realized.
184 * The x position to be identified.
186 * The y position to be identified.
188 * A pointer to a GtkTreePath pointer to be filled in, or NULL
190 * A pointer to a GtkTreeViewColumn pointer to be filled in, or NULL
192 * A pointer where the X coordinate relative to the cell can be placed, or NULL
194 * A pointer where the Y coordinate relative to the cell can be placed, or NULL
196 * TRUE if a row exists at that coordinate.
198 int getPathAtPos(gint x
, gint y
, inout TreePath path
, inout TreeViewColumn column
, out gint cellX
, out gint cellY
)
200 GtkTreePath
* p
= path
.getTreePathStruct();
201 GtkTreeViewColumn
* c
= column
.getTreeViewColumnStruct();
203 int result
= gtk_tree_view_get_path_at_pos(gtkTreeView
, x
, y
, &p
, &c
, &cellX
, &cellY
)
206 path
= new TreePath(p
);
207 column
= new TreeViewColumn(c
);
215 * gets the first selected iter or null if no rows are selected
217 TreeIter
getSelectedIter()
219 TreeIter iter
= new TreeIter();
220 TreeSelection selection
= getSelection();
221 TreeModel model
= getModel();
222 TreePath
[] paths
= selection
.getSelectedRows(model
);
223 if ( paths
.length
> 0 )
225 model
.getIter(iter
,paths
[0]);
230 TreeIter
[] getSelectedIters()
234 TreeIter iter
= new TreeIter();
235 TreeSelection selection
= getSelection();
236 TreeModel model
= getModel();
237 TreePath
[] paths
= selection
.getSelectedRows(model
);
238 foreach ( TreePath p
; selection
.getSelectedRows(model
) )
240 //iters.length = iters.length+1;
241 //iters[iters.length-1] = model.getIter(iter,p);
242 // iters ~= model.getIter(iter,p); >>> compile error can only concatenate arrays ???
243 if ( model
.getIter(iter
,p
) )
246 iter
= new TreeIter();
250 //printf("TreeView.getSelectedIters iters.lenght = %d\n", iters.length);
255 * Inserts a column and sets it's attributes
260 * @return number of columns including the new one
262 gint
insertEditableColumn(int position
, char[] title
, CellRenderer renderer
, bool editable
)
264 // OK, this is a trick because of my ignorance on how to pass variable argument lists
267 position
= getColumns().length();
269 int tot
= gtk_tree_view_insert_column_with_attributes(
272 Str
.toStringz(title
),
273 renderer
.getCellRendererStruct(),
274 Str
.toStringz("text"),position
,//v1.getV(),
275 Str
.toStringz("editable"),2,0);//v.getV(),0);
285 // imports for the signal processing
286 private import gobject
.Signals
;
287 private import gtkc
.gdktypes
;
288 int[char[]] connectedSignals
;
290 void delegate(TreeView
)[] onColumnsChangedListeners
;
291 void addOnColumnsChanged(void delegate(TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
293 if ( !("columns-changed" in connectedSignals
) )
298 cast(GCallback
)&callBackColumnsChanged
,
302 connectedSignals
["columns-changed"] = 1;
304 onColumnsChangedListeners
~= dlg
;
306 extern(C
) static void callBackColumnsChanged(GtkTreeView
* treeViewStruct
, TreeView treeView
)
308 bool consumed
= false;
310 foreach ( void delegate(TreeView
) dlg
; treeView
.onColumnsChangedListeners
)
318 void delegate(TreeView
)[] onCursorChangedListeners
;
319 void addOnCursorChanged(void delegate(TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
321 if ( !("cursor-changed" in connectedSignals
) )
326 cast(GCallback
)&callBackCursorChanged
,
330 connectedSignals
["cursor-changed"] = 1;
332 onCursorChangedListeners
~= dlg
;
334 extern(C
) static void callBackCursorChanged(GtkTreeView
* treeViewStruct
, TreeView treeView
)
336 bool consumed
= false;
338 foreach ( void delegate(TreeView
) dlg
; treeView
.onCursorChangedListeners
)
346 gboolean
delegate(gboolean
, gboolean
, gboolean
, TreeView
)[] onExpandCollapseCursorRowListeners
;
347 void addOnExpandCollapseCursorRow(gboolean
delegate(gboolean
, gboolean
, gboolean
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
349 if ( !("expand-collapse-cursor-row" in connectedSignals
) )
353 "expand-collapse-cursor-row",
354 cast(GCallback
)&callBackExpandCollapseCursorRow
,
358 connectedSignals
["expand-collapse-cursor-row"] = 1;
360 onExpandCollapseCursorRowListeners
~= dlg
;
362 extern(C
) static void callBackExpandCollapseCursorRow(GtkTreeView
* treeviewStruct
, gboolean arg1
, gboolean arg2
, gboolean arg3
, TreeView treeView
)
364 bool consumed
= false;
366 foreach ( gboolean
delegate(gboolean
, gboolean
, gboolean
, TreeView
) dlg
; treeView
.onExpandCollapseCursorRowListeners
)
368 dlg(arg1
, arg2
, arg3
, treeView
);
374 gboolean
delegate(GtkMovementStep
, gint
, TreeView
)[] onMoveCursorListeners
;
375 void addOnMoveCursor(gboolean
delegate(GtkMovementStep
, gint
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
377 if ( !("move-cursor" in connectedSignals
) )
382 cast(GCallback
)&callBackMoveCursor
,
386 connectedSignals
["move-cursor"] = 1;
388 onMoveCursorListeners
~= dlg
;
390 extern(C
) static void callBackMoveCursor(GtkTreeView
* treeviewStruct
, GtkMovementStep arg1
, gint arg2
, TreeView treeView
)
392 bool consumed
= false;
394 foreach ( gboolean
delegate(GtkMovementStep
, gint
, TreeView
) dlg
; treeView
.onMoveCursorListeners
)
396 dlg(arg1
, arg2
, treeView
);
402 void delegate(TreePath
, TreeViewColumn
, TreeView
)[] onRowActivatedListeners
;
403 void addOnRowActivated(void delegate(TreePath
, TreeViewColumn
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
405 if ( !("row-activated" in connectedSignals
) )
410 cast(GCallback
)&callBackRowActivated
,
414 connectedSignals
["row-activated"] = 1;
416 onRowActivatedListeners
~= dlg
;
418 extern(C
) static void callBackRowActivated(GtkTreeView
* treeViewStruct
, GtkTreePath
* path
, GtkTreeViewColumn
* column
, TreeView treeView
)
420 bool consumed
= false;
422 foreach ( void delegate(TreePath
, TreeViewColumn
, TreeView
) dlg
; treeView
.onRowActivatedListeners
)
424 dlg(new TreePath(path
), new TreeViewColumn(column
), treeView
);
430 void delegate(GtkTreeIter
*, TreePath
, TreeView
)[] onRowCollapsedListeners
;
431 void addOnRowCollapsed(void delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
433 if ( !("row-collapsed" in connectedSignals
) )
438 cast(GCallback
)&callBackRowCollapsed
,
442 connectedSignals
["row-collapsed"] = 1;
444 onRowCollapsedListeners
~= dlg
;
446 extern(C
) static void callBackRowCollapsed(GtkTreeView
* treeViewStruct
, GtkTreeIter
* iter
, GtkTreePath
* path
, TreeView treeView
)
448 bool consumed
= false;
450 foreach ( void delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
; treeView
.onRowCollapsedListeners
)
452 dlg(iter
, new TreePath(path
), treeView
);
458 void delegate(GtkTreeIter
*, TreePath
, TreeView
)[] onRowExpandedListeners
;
459 void addOnRowExpanded(void delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
461 if ( !("row-expanded" in connectedSignals
) )
466 cast(GCallback
)&callBackRowExpanded
,
470 connectedSignals
["row-expanded"] = 1;
472 onRowExpandedListeners
~= dlg
;
474 extern(C
) static void callBackRowExpanded(GtkTreeView
* treeViewStruct
, GtkTreeIter
* iter
, GtkTreePath
* path
, TreeView treeView
)
476 bool consumed
= false;
478 foreach ( void delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
; treeView
.onRowExpandedListeners
)
480 dlg(iter
, new TreePath(path
), treeView
);
486 gboolean
delegate(TreeView
)[] onSelectAllListeners
;
487 void addOnSelectAll(gboolean
delegate(TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
489 if ( !("select-all" in connectedSignals
) )
494 cast(GCallback
)&callBackSelectAll
,
498 connectedSignals
["select-all"] = 1;
500 onSelectAllListeners
~= dlg
;
502 extern(C
) static void callBackSelectAll(GtkTreeView
* treeviewStruct
, TreeView treeView
)
504 bool consumed
= false;
506 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onSelectAllListeners
)
514 gboolean
delegate(TreeView
)[] onSelectCursorParentListeners
;
515 void addOnSelectCursorParent(gboolean
delegate(TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
517 if ( !("select-cursor-parent" in connectedSignals
) )
521 "select-cursor-parent",
522 cast(GCallback
)&callBackSelectCursorParent
,
526 connectedSignals
["select-cursor-parent"] = 1;
528 onSelectCursorParentListeners
~= dlg
;
530 extern(C
) static void callBackSelectCursorParent(GtkTreeView
* treeviewStruct
, TreeView treeView
)
532 bool consumed
= false;
534 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onSelectCursorParentListeners
)
542 gboolean
delegate(gboolean
, TreeView
)[] onSelectCursorRowListeners
;
543 void addOnSelectCursorRow(gboolean
delegate(gboolean
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
545 if ( !("select-cursor-row" in connectedSignals
) )
550 cast(GCallback
)&callBackSelectCursorRow
,
554 connectedSignals
["select-cursor-row"] = 1;
556 onSelectCursorRowListeners
~= dlg
;
558 extern(C
) static void callBackSelectCursorRow(GtkTreeView
* treeviewStruct
, gboolean arg1
, TreeView treeView
)
560 bool consumed
= false;
562 foreach ( gboolean
delegate(gboolean
, TreeView
) dlg
; treeView
.onSelectCursorRowListeners
)
570 void delegate(Adjustment
, Adjustment
, TreeView
)[] onSetScrollAdjustmentsListeners
;
571 void addOnSetScrollAdjustments(void delegate(Adjustment
, Adjustment
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
573 if ( !("set-scroll-adjustments" in connectedSignals
) )
577 "set-scroll-adjustments",
578 cast(GCallback
)&callBackSetScrollAdjustments
,
582 connectedSignals
["set-scroll-adjustments"] = 1;
584 onSetScrollAdjustmentsListeners
~= dlg
;
586 extern(C
) static void callBackSetScrollAdjustments(GtkTreeView
* treeviewStruct
, GtkAdjustment
* arg1
, GtkAdjustment
* arg2
, TreeView treeView
)
588 bool consumed
= false;
590 foreach ( void delegate(Adjustment
, Adjustment
, TreeView
) dlg
; treeView
.onSetScrollAdjustmentsListeners
)
592 dlg(new Adjustment(arg1
), new Adjustment(arg2
), treeView
);
598 gboolean
delegate(TreeView
)[] onStartInteractiveSearchListeners
;
599 void addOnStartInteractiveSearch(gboolean
delegate(TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
601 if ( !("start-interactive-search" in connectedSignals
) )
605 "start-interactive-search",
606 cast(GCallback
)&callBackStartInteractiveSearch
,
610 connectedSignals
["start-interactive-search"] = 1;
612 onStartInteractiveSearchListeners
~= dlg
;
614 extern(C
) static void callBackStartInteractiveSearch(GtkTreeView
* treeviewStruct
, TreeView treeView
)
616 bool consumed
= false;
618 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onStartInteractiveSearchListeners
)
626 gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
)[] onTestCollapseRowListeners
;
627 void addOnTestCollapseRow(gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
629 if ( !("test-collapse-row" in connectedSignals
) )
634 cast(GCallback
)&callBackTestCollapseRow
,
638 connectedSignals
["test-collapse-row"] = 1;
640 onTestCollapseRowListeners
~= dlg
;
642 extern(C
) static void callBackTestCollapseRow(GtkTreeView
* treeViewStruct
, GtkTreeIter
* iter
, GtkTreePath
* path
, TreeView treeView
)
644 bool consumed
= false;
646 foreach ( gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
; treeView
.onTestCollapseRowListeners
)
648 dlg(iter
, new TreePath(path
), treeView
);
654 gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
)[] onTestExpandRowListeners
;
655 void addOnTestExpandRow(gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
657 if ( !("test-expand-row" in connectedSignals
) )
662 cast(GCallback
)&callBackTestExpandRow
,
666 connectedSignals
["test-expand-row"] = 1;
668 onTestExpandRowListeners
~= dlg
;
670 extern(C
) static void callBackTestExpandRow(GtkTreeView
* treeViewStruct
, GtkTreeIter
* iter
, GtkTreePath
* path
, TreeView treeView
)
672 bool consumed
= false;
674 foreach ( gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
; treeView
.onTestExpandRowListeners
)
676 dlg(iter
, new TreePath(path
), treeView
);
682 gboolean
delegate(TreeView
)[] onToggleCursorRowListeners
;
683 void addOnToggleCursorRow(gboolean
delegate(TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
685 if ( !("toggle-cursor-row" in connectedSignals
) )
690 cast(GCallback
)&callBackToggleCursorRow
,
694 connectedSignals
["toggle-cursor-row"] = 1;
696 onToggleCursorRowListeners
~= dlg
;
698 extern(C
) static void callBackToggleCursorRow(GtkTreeView
* treeviewStruct
, TreeView treeView
)
700 bool consumed
= false;
702 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onToggleCursorRowListeners
)
710 gboolean
delegate(TreeView
)[] onUnselectAllListeners
;
711 void addOnUnselectAll(gboolean
delegate(TreeView
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
713 if ( !("unselect-all" in connectedSignals
) )
718 cast(GCallback
)&callBackUnselectAll
,
722 connectedSignals
["unselect-all"] = 1;
724 onUnselectAllListeners
~= dlg
;
726 extern(C
) static void callBackUnselectAll(GtkTreeView
* treeviewStruct
, TreeView treeView
)
728 bool consumed
= false;
730 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onUnselectAllListeners
)
746 * Creates a new GtkTreeView widget.
748 * A newly created GtkTreeView widget.
752 // GtkWidget* gtk_tree_view_new (void);
753 this(cast(GtkTreeView
*)gtk_tree_view_new() );
757 * Returns the amount, in pixels, of extra indentation for child levels
762 * the amount of extra indentation for child levels in
763 * tree_view. A return value of 0 means that this feature is disabled.
766 public int getLevelIndentation()
768 // gint gtk_tree_view_get_level_indentation (GtkTreeView *tree_view);
769 return gtk_tree_view_get_level_indentation(gtkTreeView
);
773 * Returns whether or not expanders are drawn in tree_view.
777 * TRUE if expanders are drawn in tree_view, FALSE
781 public int getShowExpanders()
783 // gboolean gtk_tree_view_get_show_expanders (GtkTreeView *tree_view);
784 return gtk_tree_view_get_show_expanders(gtkTreeView
);
788 * Sets the amount of extra indentation for child levels to use in tree_view
789 * in addition to the default indentation. The value should be specified in
790 * pixels, a value of 0 disables this feature and in this case only the default
791 * indentation will be used.
792 * This does not have any visible effects for lists.
796 * the amount, in pixels, of extra indentation in tree_view.
799 public void setLevelIndentation(int indentation
)
801 // void gtk_tree_view_set_level_indentation (GtkTreeView *tree_view, gint indentation);
802 gtk_tree_view_set_level_indentation(gtkTreeView
, indentation
);
806 * Sets whether to draw and enable expanders and indent child rows in
807 * tree_view. When disabled there will be no expanders visible in trees
808 * and there will be no way to expand and collapse rows by default. Also
809 * note that hiding the expanders will disable the default indentation. You
810 * can set a custom indentation in this case using
811 * gtk_tree_view_set_level_indentation().
812 * This does not have any visible effects for lists.
816 * TRUE to enable expander drawing, FALSE otherwise.
819 public void setShowExpanders(int enabled
)
821 // void gtk_tree_view_set_show_expanders (GtkTreeView *tree_view, gboolean enabled);
822 gtk_tree_view_set_show_expanders(gtkTreeView
, enabled
);
826 * Creates a new GtkTreeView widget with the model initialized to model.
830 * A newly created GtkTreeView widget.
832 public this (TreeModel model
)
834 // GtkWidget* gtk_tree_view_new_with_model (GtkTreeModel *model);
835 this(cast(GtkTreeView
*)gtk_tree_view_new_with_model((model
is null) ?
null : model
.getTreeModelStruct()) );
839 * Returns the model the GtkTreeView is based on. Returns NULL if the
844 * A GtkTreeModel, or NULL if none is currently being used.
846 public TreeModel
getModel()
848 // GtkTreeModel* gtk_tree_view_get_model (GtkTreeView *tree_view);
849 return new TreeModel( gtk_tree_view_get_model(gtkTreeView
) );
853 * Sets the model for a GtkTreeView. If the tree_view already has a model
854 * set, it will remove it before setting the new model. If model is NULL,
855 * then it will unset the old model.
861 public void setModel(TreeModel model
)
863 // void gtk_tree_view_set_model (GtkTreeView *tree_view, GtkTreeModel *model);
864 gtk_tree_view_set_model(gtkTreeView
, (model
is null) ?
null : model
.getTreeModelStruct());
868 * Gets the GtkTreeSelection associated with tree_view.
872 * A GtkTreeSelection object.
874 public TreeSelection
getSelection()
876 // GtkTreeSelection* gtk_tree_view_get_selection (GtkTreeView *tree_view);
877 return new TreeSelection( gtk_tree_view_get_selection(gtkTreeView
) );
881 * Gets the GtkAdjustment currently being used for the horizontal aspect.
885 * A GtkAdjustment object, or NULL if none is currently being
888 public Adjustment
getHadjustment()
890 // GtkAdjustment* gtk_tree_view_get_hadjustment (GtkTreeView *tree_view);
891 return new Adjustment( gtk_tree_view_get_hadjustment(gtkTreeView
) );
895 * Sets the GtkAdjustment for the current horizontal aspect.
899 * The GtkAdjustment to set, or NULL
901 public void setHadjustment(Adjustment adjustment
)
903 // void gtk_tree_view_set_hadjustment (GtkTreeView *tree_view, GtkAdjustment *adjustment);
904 gtk_tree_view_set_hadjustment(gtkTreeView
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());
908 * Gets the GtkAdjustment currently being used for the vertical aspect.
912 * A GtkAdjustment object, or NULL if none is currently being
915 public Adjustment
getVadjustment()
917 // GtkAdjustment* gtk_tree_view_get_vadjustment (GtkTreeView *tree_view);
918 return new Adjustment( gtk_tree_view_get_vadjustment(gtkTreeView
) );
922 * Sets the GtkAdjustment for the current vertical aspect.
926 * The GtkAdjustment to set, or NULL
928 public void setVadjustment(Adjustment adjustment
)
930 // void gtk_tree_view_set_vadjustment (GtkTreeView *tree_view, GtkAdjustment *adjustment);
931 gtk_tree_view_set_vadjustment(gtkTreeView
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());
935 * Returns TRUE if the headers on the tree_view are visible.
939 * Whether the headers are visible or not.
941 public int getHeadersVisible()
943 // gboolean gtk_tree_view_get_headers_visible (GtkTreeView *tree_view);
944 return gtk_tree_view_get_headers_visible(gtkTreeView
);
948 * Sets the visibility state of the headers.
952 * TRUE if the headers are visible
954 public void setHeadersVisible(int headersVisible
)
956 // void gtk_tree_view_set_headers_visible (GtkTreeView *tree_view, gboolean headers_visible);
957 gtk_tree_view_set_headers_visible(gtkTreeView
, headersVisible
);
961 * Resizes all columns to their optimal width. Only works after the
962 * treeview has been realized.
966 public void columnsAutosize()
968 // void gtk_tree_view_columns_autosize (GtkTreeView *tree_view);
969 gtk_tree_view_columns_autosize(gtkTreeView
);
973 * Returns whether all header columns are clickable.
977 * TRUE if all header columns are clickable, otherwise FALSE
980 public int getHeadersClickable()
982 // gboolean gtk_tree_view_get_headers_clickable (GtkTreeView *tree_view);
983 return gtk_tree_view_get_headers_clickable(gtkTreeView
);
987 * Allow the column title buttons to be clicked.
991 * TRUE if the columns are clickable.
993 public void setHeadersClickable(int setting
)
995 // void gtk_tree_view_set_headers_clickable (GtkTreeView *tree_view, gboolean setting);
996 gtk_tree_view_set_headers_clickable(gtkTreeView
, setting
);
1000 * This function tells GTK+ that the user interface for your
1001 * application requires users to read across tree rows and associate
1002 * cells with one another. By default, GTK+ will then render the tree
1003 * with alternating row colors. Do not use it
1004 * just because you prefer the appearance of the ruled tree; that's a
1005 * question for the theme. Some themes will draw tree rows in
1006 * alternating colors even when rules are turned off, and users who
1007 * prefer that appearance all the time can choose those themes. You
1008 * should call this function only as a semantic
1009 * hint to the theme engine that your tree makes alternating colors
1010 * useful from a functional standpoint (since it has lots of columns,
1015 * TRUE if the tree requires reading across rows
1017 public void setRulesHint(int setting
)
1019 // void gtk_tree_view_set_rules_hint (GtkTreeView *tree_view, gboolean setting);
1020 gtk_tree_view_set_rules_hint(gtkTreeView
, setting
);
1024 * Gets the setting set by gtk_tree_view_set_rules_hint().
1028 * TRUE if rules are useful for the user of this tree
1030 public int getRulesHint()
1032 // gboolean gtk_tree_view_get_rules_hint (GtkTreeView *tree_view);
1033 return gtk_tree_view_get_rules_hint(gtkTreeView
);
1037 * Appends column to the list of columns. If tree_view has "fixed_height"
1038 * mode enabled, then column must have its "sizing" property set to be
1039 * GTK_TREE_VIEW_COLUMN_FIXED.
1043 * The GtkTreeViewColumn to add.
1045 * The number of columns in tree_view after appending.
1047 public int appendColumn(TreeViewColumn column
)
1049 // gint gtk_tree_view_append_column (GtkTreeView *tree_view, GtkTreeViewColumn *column);
1050 return gtk_tree_view_append_column(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct());
1054 * Removes column from tree_view.
1058 * The GtkTreeViewColumn to remove.
1060 * The number of columns in tree_view after removing.
1062 public int removeColumn(TreeViewColumn column
)
1064 // gint gtk_tree_view_remove_column (GtkTreeView *tree_view, GtkTreeViewColumn *column);
1065 return gtk_tree_view_remove_column(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct());
1069 * This inserts the column into the tree_view at position. If position is
1070 * -1, then the column is inserted at the end. If tree_view has
1071 * "fixed_height" mode enabled, then column must have its "sizing" property
1072 * set to be GTK_TREE_VIEW_COLUMN_FIXED.
1076 * The GtkTreeViewColumn to be inserted.
1078 * The position to insert column in.
1080 * The number of columns in tree_view after insertion.
1082 public int insertColumn(TreeViewColumn column
, int position
)
1084 // gint gtk_tree_view_insert_column (GtkTreeView *tree_view, GtkTreeViewColumn *column, gint position);
1085 return gtk_tree_view_insert_column(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct(), position
);
1089 * Creates a new GtkTreeViewColumn and inserts it into the tree_view at
1090 * position. If position is -1, then the newly created column is inserted at
1091 * the end. The column is initialized with the attributes given. If tree_view
1092 * has "fixed_height" mode enabled, then the new column will have its sizing
1093 * property set to be GTK_TREE_VIEW_COLUMN_FIXED.
1097 * The position to insert the new column in.
1099 * The title to set the header to.
1101 * The GtkCellRenderer.
1103 * A NULL-terminated list of attributes.
1105 * The number of columns in tree_view after insertion.
1107 public int insertColumnWithAttributes(int position
, char[] title
, CellRenderer cell
, ... )
1109 // gint gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view, gint position, const gchar *title, GtkCellRenderer *cell, ...);
1110 return gtk_tree_view_insert_column_with_attributes(gtkTreeView
, position
, Str
.toStringz(title
), (cell
is null) ?
null : cell
.getCellRendererStruct());
1114 * Convenience function that inserts a new column into the GtkTreeView
1115 * with the given cell renderer and a GtkCellDataFunc to set cell renderer
1116 * attributes (normally using data from the model). See also
1117 * gtk_tree_view_column_set_cell_data_func(), gtk_tree_view_column_pack_start().
1118 * If tree_view has "fixed_height" mode enabled, then the new column will have its
1119 * "sizing" property set to be GTK_TREE_VIEW_COLUMN_FIXED.
1123 * Position to insert, -1 for append
1127 * cell renderer for column
1129 * function to set attributes of cell renderer
1133 * destroy notifier for data
1135 * number of columns in the tree view post-insert
1137 public int insertColumnWithDataFunc(int position
, char[] title
, CellRenderer cell
, GtkTreeCellDataFunc func
, void* data
, GDestroyNotify dnotify
)
1139 // gint gtk_tree_view_insert_column_with_data_func (GtkTreeView *tree_view, gint position, const gchar *title, GtkCellRenderer *cell, GtkTreeCellDataFunc func, gpointer data, GDestroyNotify dnotify);
1140 return gtk_tree_view_insert_column_with_data_func(gtkTreeView
, position
, Str
.toStringz(title
), (cell
is null) ?
null : cell
.getCellRendererStruct(), func
, data
, dnotify
);
1144 * Gets the GtkTreeViewColumn at the given position in the tree_view.
1148 * The position of the column, counting from 0.
1150 * The GtkTreeViewColumn, or NULL if the position is outside the
1153 public TreeViewColumn
getColumn(int n
)
1155 // GtkTreeViewColumn* gtk_tree_view_get_column (GtkTreeView *tree_view, gint n);
1156 return new TreeViewColumn( gtk_tree_view_get_column(gtkTreeView
, n
) );
1160 * Returns a GList of all the GtkTreeViewColumn s currently in tree_view.
1161 * The returned list must be freed with g_list_free().
1165 * A list of GtkTreeViewColumn s
1167 public ListG
getColumns()
1169 // GList* gtk_tree_view_get_columns (GtkTreeView *tree_view);
1170 return new ListG( gtk_tree_view_get_columns(gtkTreeView
) );
1174 * Moves column to be after to base_column. If base_column is NULL, then
1175 * column is placed in the first position.
1179 * The GtkTreeViewColumn to be moved.
1181 * The GtkTreeViewColumn to be moved relative to, or NULL.
1183 public void moveColumnAfter(TreeViewColumn column
, TreeViewColumn baseColumn
)
1185 // void gtk_tree_view_move_column_after (GtkTreeView *tree_view, GtkTreeViewColumn *column, GtkTreeViewColumn *base_column);
1186 gtk_tree_view_move_column_after(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct(), (baseColumn
is null) ?
null : baseColumn
.getTreeViewColumnStruct());
1190 * Sets the column to draw the expander arrow at. It must be in tree_view.
1191 * If column is NULL, then the expander arrow is always at the first
1193 * If you do not want expander arrow to appear in your tree, set the
1194 * expander column to a hidden column.
1198 * NULL, or the column to draw the expander arrow at.
1200 public void setExpanderColumn(TreeViewColumn column
)
1202 // void gtk_tree_view_set_expander_column (GtkTreeView *tree_view, GtkTreeViewColumn *column);
1203 gtk_tree_view_set_expander_column(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct());
1207 * Returns the column that is the current expander column. This
1208 * column has the expander arrow drawn next to it.
1212 * The expander column.
1214 public TreeViewColumn
getExpanderColumn()
1216 // GtkTreeViewColumn* gtk_tree_view_get_expander_column (GtkTreeView *tree_view);
1217 return new TreeViewColumn( gtk_tree_view_get_expander_column(gtkTreeView
) );
1221 * Sets a user function for determining where a column may be dropped when
1222 * dragged. This function is called on every column pair in turn at the
1223 * beginning of a column drag to determine where a drop can take place. The
1224 * arguments passed to func are: the tree_view, the GtkTreeViewColumn being
1225 * dragged, the two GtkTreeViewColumn s determining the drop spot, and
1226 * user_data. If either of the GtkTreeViewColumn arguments for the drop spot
1227 * are NULL, then they indicate an edge. If func is set to be NULL, then
1228 * tree_view reverts to the default behavior of allowing all columns to be
1229 * dropped everywhere.
1233 * A function to determine which columns are reorderable, or NULL.
1235 * User data to be passed to func, or NULL
1237 * Destroy notifier for user_data, or NULL
1239 public void setColumnDragFunction(GtkTreeViewColumnDropFunc func
, void* userData
, GtkDestroyNotify destroy
)
1241 // void gtk_tree_view_set_column_drag_function (GtkTreeView *tree_view, GtkTreeViewColumnDropFunc func, gpointer user_data, GtkDestroyNotify destroy);
1242 gtk_tree_view_set_column_drag_function(gtkTreeView
, func
, userData
, destroy
);
1246 * Scrolls the tree view such that the top-left corner of the visible
1247 * area is tree_x, tree_y, where tree_x and tree_y are specified
1248 * in tree window coordinates. The tree_view must be realized before
1249 * this function is called. If it isn't, you probably want to be
1250 * using gtk_tree_view_scroll_to_cell().
1251 * If either tree_x or tree_y are -1, then that direction isn't scrolled.
1255 * X coordinate of new top-left pixel of visible area, or -1
1257 * Y coordinate of new top-left pixel of visible area, or -1
1259 public void scrollToPoint(int treeX
, int treeY
)
1261 // void gtk_tree_view_scroll_to_point (GtkTreeView *tree_view, gint tree_x, gint tree_y);
1262 gtk_tree_view_scroll_to_point(gtkTreeView
, treeX
, treeY
);
1266 * Moves the alignments of tree_view to the position specified by column and
1267 * path. If column is NULL, then no horizontal scrolling occurs. Likewise,
1268 * if path is NULL no vertical scrolling occurs. At a minimum, one of column
1269 * or path need to be non-NULL. row_align determines where the row is
1270 * placed, and col_align determines where column is placed. Both are expected
1271 * to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means
1272 * right/bottom alignment, 0.5 means center.
1273 * If use_align is FALSE, then the alignment arguments are ignored, and the
1274 * tree does the minimum amount of work to scroll the cell onto the screen.
1275 * This means that the cell will be scrolled to the edge closest to its current
1276 * position. If the cell is currently visible on the screen, nothing is done.
1277 * This function only works if the model is set, and path is a valid row on the
1278 * model. If the model changes before the tree_view is realized, the centered
1279 * path will be modified to reflect this change.
1283 * The path of the row to move to, or NULL.
1285 * The GtkTreeViewColumn to move horizontally to, or NULL.
1287 * whether to use alignment arguments, or FALSE.
1289 * The vertical alignment of the row specified by path.
1291 * The horizontal alignment of the column specified by column.
1293 public void scrollToCell(TreePath path
, TreeViewColumn column
, int useAlign
, float rowAlign
, float colAlign
)
1295 // void gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gboolean use_align, gfloat row_align, gfloat col_align);
1296 gtk_tree_view_scroll_to_cell(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (column
is null) ?
null : column
.getTreeViewColumnStruct(), useAlign
, rowAlign
, colAlign
);
1300 * Sets the current keyboard focus to be at path, and selects it. This is
1301 * useful when you want to focus the user's attention on a particular row. If
1302 * focus_column is not NULL, then focus is given to the column specified by
1303 * it. Additionally, if focus_column is specified, and start_editing is
1304 * TRUE, then editing should be started in the specified cell.
1305 * This function is often followed by gtk_widget_grab_focus (tree_view)
1306 * in order to give keyboard focus to the widget. Please note that editing
1307 * can only happen when the widget is realized.
1313 * A GtkTreeViewColumn, or NULL
1315 * TRUE if the specified cell should start being edited.
1317 public void setCursor(TreePath path
, TreeViewColumn focusColumn
, int startEditing
)
1319 // void gtk_tree_view_set_cursor (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *focus_column, gboolean start_editing);
1320 gtk_tree_view_set_cursor(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (focusColumn
is null) ?
null : focusColumn
.getTreeViewColumnStruct(), startEditing
);
1324 * Sets the current keyboard focus to be at path, and selects it. This is
1325 * useful when you want to focus the user's attention on a particular row. If
1326 * focus_column is not NULL, then focus is given to the column specified by
1327 * it. If focus_column and focus_cell are not NULL, and focus_column
1328 * contains 2 or more editable or activatable cells, then focus is given to
1329 * the cell specified by focus_cell. Additionally, if focus_column is
1330 * specified, and start_editing is TRUE, then editing should be started in
1331 * the specified cell. This function is often followed by
1332 * gtk_widget_grab_focus (tree_view) in order to give keyboard focus to the
1333 * widget. Please note that editing can only happen when the widget is
1340 * A GtkTreeViewColumn, or NULL
1342 * A GtkCellRenderer, or NULL
1344 * TRUE if the specified cell should start being edited.
1347 public void setCursorOnCell(TreePath path
, TreeViewColumn focusColumn
, CellRenderer focusCell
, int startEditing
)
1349 // void gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *focus_column, GtkCellRenderer *focus_cell, gboolean start_editing);
1350 gtk_tree_view_set_cursor_on_cell(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (focusColumn
is null) ?
null : focusColumn
.getTreeViewColumnStruct(), (focusCell
is null) ?
null : focusCell
.getCellRendererStruct(), startEditing
);
1354 * Fills in path and focus_column with the current path and focus column. If
1355 * the cursor isn't currently set, then *path will be NULL. If no column
1356 * currently has focus, then *focus_column will be NULL.
1357 * The returned GtkTreePath must be freed with gtk_tree_path_free() when
1358 * you are done with it.
1362 * A pointer to be filled with the current cursor path, or NULL
1364 * A pointer to be filled with the current focus column, or NULL
1366 public void getCursor(GtkTreePath
** path
, GtkTreeViewColumn
** focusColumn
)
1368 // void gtk_tree_view_get_cursor (GtkTreeView *tree_view, GtkTreePath **path, GtkTreeViewColumn **focus_column);
1369 gtk_tree_view_get_cursor(gtkTreeView
, path
, focusColumn
);
1373 * Activates the cell determined by path and column.
1377 * The GtkTreePath to be activated.
1379 * The GtkTreeViewColumn to be activated.
1381 public void rowActivated(TreePath path
, TreeViewColumn column
)
1383 // void gtk_tree_view_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column);
1384 gtk_tree_view_row_activated(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (column
is null) ?
null : column
.getTreeViewColumnStruct());
1388 * Recursively expands all nodes in the tree_view.
1392 public void expandAll()
1394 // void gtk_tree_view_expand_all (GtkTreeView *tree_view);
1395 gtk_tree_view_expand_all(gtkTreeView
);
1399 * Recursively collapses all visible, expanded nodes in tree_view.
1403 public void collapseAll()
1405 // void gtk_tree_view_collapse_all (GtkTreeView *tree_view);
1406 gtk_tree_view_collapse_all(gtkTreeView
);
1410 * Expands the row at path. This will also expand all parent rows of
1411 * path as necessary.
1418 public void expandToPath(TreePath path
)
1420 // void gtk_tree_view_expand_to_path (GtkTreeView *tree_view, GtkTreePath *path);
1421 gtk_tree_view_expand_to_path(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct());
1425 * Opens the row so its children are visible.
1431 * whether to recursively expand, or just expand immediate children
1433 * TRUE if the row existed and had children
1435 public int expandRow(TreePath path
, int openAll
)
1437 // gboolean gtk_tree_view_expand_row (GtkTreeView *tree_view, GtkTreePath *path, gboolean open_all);
1438 return gtk_tree_view_expand_row(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), openAll
);
1442 * Collapses a row (hides its child rows, if they exist).
1446 * path to a row in the tree_view
1448 * TRUE if the row was collapsed.
1450 public int collapseRow(TreePath path
)
1452 // gboolean gtk_tree_view_collapse_row (GtkTreeView *tree_view, GtkTreePath *path);
1453 return gtk_tree_view_collapse_row(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct());
1457 * Calls func on all expanded rows.
1461 * A function to be called
1463 * User data to be passed to the function.
1465 public void mapExpandedRows(GtkTreeViewMappingFunc func
, void* data
)
1467 // void gtk_tree_view_map_expanded_rows (GtkTreeView *tree_view, GtkTreeViewMappingFunc func, gpointer data);
1468 gtk_tree_view_map_expanded_rows(gtkTreeView
, func
, data
);
1472 * Returns TRUE if the node pointed to by path is expanded in tree_view.
1476 * A GtkTreePath to test expansion state.
1478 * TRUE if path is expanded.
1480 public int rowExpanded(TreePath path
)
1482 // gboolean gtk_tree_view_row_expanded (GtkTreeView *tree_view, GtkTreePath *path);
1483 return gtk_tree_view_row_expanded(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct());
1487 * This function is a convenience function to allow you to reorder models that
1488 * support the GtkDragSourceIface and the GtkDragDestIface. Both
1489 * GtkTreeStore and GtkListStore support these. If reorderable is TRUE, then
1490 * the user can reorder the model by dragging and dropping rows. The
1491 * developer can listen to these changes by connecting to the model's
1492 * row_inserted and row_deleted signals.
1493 * This function does not give you any degree of control over the order -- any
1494 * reordering is allowed. If more control is needed, you should probably
1495 * handle drag and drop manually.
1499 * TRUE, if the tree can be reordered.
1501 public void setReorderable(int reorderable
)
1503 // void gtk_tree_view_set_reorderable (GtkTreeView *tree_view, gboolean reorderable);
1504 gtk_tree_view_set_reorderable(gtkTreeView
, reorderable
);
1508 * Retrieves whether the user can reorder the tree via drag-and-drop. See
1509 * gtk_tree_view_set_reorderable().
1513 * TRUE if the tree can be reordered.
1515 public int getReorderable()
1517 // gboolean gtk_tree_view_get_reorderable (GtkTreeView *tree_view);
1518 return gtk_tree_view_get_reorderable(gtkTreeView
);
1522 * Finds the path at the point (x, y), relative to widget coordinates. That
1523 * is, x and y are relative to an events coordinates. x and y must come
1524 * from an event on the tree_view only where event->window ==
1525 * gtk_tree_view_get_bin (). It is primarily for things
1526 * like popup menus. If path is non-NULL, then it will be filled with the
1527 * GtkTreePath at that point. This path should be freed with gtk_tree_path_free().
1528 * If column is non-NULL, then it will be filled with the column at that point.
1529 * cell_x and cell_y return the coordinates relative to the cell background
1530 * (i.e. the background_area passed to gtk_cell_renderer_render()). This
1531 * function is only meaningful if tree_view is realized.
1535 * The x position to be identified.
1537 * The y position to be identified.
1539 * A pointer to a GtkTreePath pointer to be filled in, or NULL
1541 * A pointer to a GtkTreeViewColumn pointer to be filled in, or NULL
1543 * A pointer where the X coordinate relative to the cell can be placed, or NULL
1545 * A pointer where the Y coordinate relative to the cell can be placed, or NULL
1547 * TRUE if a row exists at that coordinate.
1549 public int getPathAtPos(int x
, int y
, GtkTreePath
** path
, GtkTreeViewColumn
** column
, int* cellX
, int* cellY
)
1551 // gboolean gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view, gint x, gint y, GtkTreePath **path, GtkTreeViewColumn **column, gint *cell_x, gint *cell_y);
1552 return gtk_tree_view_get_path_at_pos(gtkTreeView
, x
, y
, path
, column
, cellX
, cellY
);
1556 * Fills the bounding rectangle in tree window coordinates for the cell at the
1557 * row specified by path and the column specified by column. If path is
1558 * NULL, or points to a path not currently displayed, the y and height fields
1559 * of the rectangle will be filled with 0. If column is NULL, the x and width
1560 * fields will be filled with 0. The sum of all cell rects does not cover the
1561 * entire tree; there are extra pixels in between rows, for example. The
1562 * returned rectangle is equivalent to the cell_area passed to
1563 * gtk_cell_renderer_render(). This function is only valid if tree_view is
1568 * a GtkTreePath for the row, or NULL to get only horizontal coordinates
1570 * a GtkTreeViewColumn for the column, or NULL to get only vertical coordinates
1572 * rectangle to fill with cell rect
1574 public void getCellArea(TreePath path
, TreeViewColumn column
, Rectangle rect
)
1576 // void gtk_tree_view_get_cell_area (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, GdkRectangle *rect);
1577 gtk_tree_view_get_cell_area(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (column
is null) ?
null : column
.getTreeViewColumnStruct(), (rect
is null) ?
null : rect
.getRectangleStruct());
1581 * Fills the bounding rectangle in tree window coordinates for the cell at the
1582 * row specified by path and the column specified by column. If path is
1583 * NULL, or points to a node not found in the tree, the y and height fields of
1584 * the rectangle will be filled with 0. If column is NULL, the x and width
1585 * fields will be filled with 0. The returned rectangle is equivalent to the
1586 * background_area passed to gtk_cell_renderer_render(). These background
1587 * areas tile to cover the entire tree window (except for the area used for
1588 * header buttons). Contrast with the cell_area, returned by
1589 * gtk_tree_view_get_cell_area(), which returns only the cell itself, excluding
1590 * surrounding borders and the tree expander area.
1594 * a GtkTreePath for the row, or NULL to get only horizontal coordinates
1596 * a GtkTreeViewColumn for the column, or NULL to get only vertical coordiantes
1598 * rectangle to fill with cell background rect
1600 public void getBackgroundArea(TreePath path
, TreeViewColumn column
, Rectangle rect
)
1602 // void gtk_tree_view_get_background_area (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, GdkRectangle *rect);
1603 gtk_tree_view_get_background_area(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (column
is null) ?
null : column
.getTreeViewColumnStruct(), (rect
is null) ?
null : rect
.getRectangleStruct());
1607 * Fills visible_rect with the currently-visible region of the
1608 * buffer, in tree coordinates. Convert to widget coordinates with
1609 * gtk_tree_view_tree_to_widget_coords(). Tree coordinates start at
1610 * 0,0 for row 0 of the tree, and cover the entire scrollable area of
1617 public void getVisibleRect(Rectangle visibleRect
)
1619 // void gtk_tree_view_get_visible_rect (GtkTreeView *tree_view, GdkRectangle *visible_rect);
1620 gtk_tree_view_get_visible_rect(gtkTreeView
, (visibleRect
is null) ?
null : visibleRect
.getRectangleStruct());
1624 * Sets start_path and end_path to be the first and last visible path.
1625 * Note that there may be invisible paths in between.
1626 * The paths should be freed with gtk_tree_path_free() after use.
1630 * Return location for start of region, or NULL.
1632 * Return location for end of region, or NULL.
1634 * TRUE, if valid paths were placed in start_path and end_path.
1637 public int getVisibleRange(GtkTreePath
** startPath
, GtkTreePath
** endPath
)
1639 // gboolean gtk_tree_view_get_visible_range (GtkTreeView *tree_view, GtkTreePath **start_path, GtkTreePath **end_path);
1640 return gtk_tree_view_get_visible_range(gtkTreeView
, startPath
, endPath
);
1644 * Returns the window that tree_view renders to. This is used primarily to
1645 * compare to event->window to confirm that the event on
1646 * tree_view is on the right window.
1650 * A GdkWindow, or NULL when tree_view hasn't been realized yet
1652 public Window
getBinWindow()
1654 // GdkWindow* gtk_tree_view_get_bin_window (GtkTreeView *tree_view);
1655 return new Window( gtk_tree_view_get_bin_window(gtkTreeView
) );
1659 * Converts widget coordinates to coordinates for the
1660 * tree window (the full scrollable area of the tree).
1664 * widget X coordinate
1666 * widget Y coordinate
1668 * return location for tree X coordinate
1670 * return location for tree Y coordinate
1672 public void widgetToTreeCoords(int wx
, int wy
, int* tx
, int* ty
)
1674 // void gtk_tree_view_widget_to_tree_coords (GtkTreeView *tree_view, gint wx, gint wy, gint *tx, gint *ty);
1675 gtk_tree_view_widget_to_tree_coords(gtkTreeView
, wx
, wy
, tx
, ty
);
1679 * Converts tree coordinates (coordinates in full scrollable area of the tree)
1680 * to widget coordinates.
1688 * return location for widget X coordinate
1690 * return location for widget Y coordinate
1692 public void treeToWidgetCoords(int tx
, int ty
, int* wx
, int* wy
)
1694 // void gtk_tree_view_tree_to_widget_coords (GtkTreeView *tree_view, gint tx, gint ty, gint *wx, gint *wy);
1695 gtk_tree_view_tree_to_widget_coords(gtkTreeView
, tx
, ty
, wx
, wy
);
1699 * Turns tree_view into a drop destination for automatic DND.
1703 * the table of targets that the drag will support
1705 * the number of items in targets
1707 * the bitmask of possible actions for a drag from this
1710 public void enableModelDragDest(GtkTargetEntry
* targets
, int nTargets
, GdkDragAction actions
)
1712 // void gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view, const GtkTargetEntry *targets, gint n_targets, GdkDragAction actions);
1713 gtk_tree_view_enable_model_drag_dest(gtkTreeView
, targets
, nTargets
, actions
);
1717 * Turns tree_view into a drag source for automatic DND.
1720 * start_button_mask:
1721 * Mask of allowed buttons to start drag
1723 * the table of targets that the drag will support
1725 * the number of items in targets
1727 * the bitmask of possible actions for a drag from this
1730 public void enableModelDragSource(GdkModifierType startButtonMask
, GtkTargetEntry
* targets
, int nTargets
, GdkDragAction actions
)
1732 // void gtk_tree_view_enable_model_drag_source (GtkTreeView *tree_view, GdkModifierType start_button_mask, const GtkTargetEntry *targets, gint n_targets, GdkDragAction actions);
1733 gtk_tree_view_enable_model_drag_source(gtkTreeView
, startButtonMask
, targets
, nTargets
, actions
);
1737 * Undoes the effect of gtk_tree_view_enable_model_drag_source().
1741 public void unsetRowsDragSource()
1743 // void gtk_tree_view_unset_rows_drag_source (GtkTreeView *tree_view);
1744 gtk_tree_view_unset_rows_drag_source(gtkTreeView
);
1748 * Undoes the effect of gtk_tree_view_enable_model_drag_dest().
1752 public void unsetRowsDragDest()
1754 // void gtk_tree_view_unset_rows_drag_dest (GtkTreeView *tree_view);
1755 gtk_tree_view_unset_rows_drag_dest(gtkTreeView
);
1759 * Sets the row that is highlighted for feedback.
1763 * The path of the row to highlight, or NULL.
1765 * Specifies whether to drop before, after or into the row
1767 public void setDragDestRow(TreePath path
, GtkTreeViewDropPosition pos
)
1769 // void gtk_tree_view_set_drag_dest_row (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewDropPosition pos);
1770 gtk_tree_view_set_drag_dest_row(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), pos
);
1774 * Gets information about the row that is highlighted for feedback.
1778 * Return location for the path of the highlighted row, or NULL.
1780 * Return location for the drop position, or NULL
1782 public void getDragDestRow(GtkTreePath
** path
, GtkTreeViewDropPosition
* pos
)
1784 // void gtk_tree_view_get_drag_dest_row (GtkTreeView *tree_view, GtkTreePath **path, GtkTreeViewDropPosition *pos);
1785 gtk_tree_view_get_drag_dest_row(gtkTreeView
, path
, pos
);
1789 * Determines the destination row for a given position.
1793 * the position to determine the destination row for
1795 * the position to determine the destination row for
1797 * Return location for the path of the highlighted row, or NULL.
1799 * Return location for the drop position, or NULL
1801 * whether there is a row at the given position.
1803 public int getDestRowAtPos(int dragX
, int dragY
, GtkTreePath
** path
, GtkTreeViewDropPosition
* pos
)
1805 // gboolean gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view, gint drag_x, gint drag_y, GtkTreePath **path, GtkTreeViewDropPosition *pos);
1806 return gtk_tree_view_get_dest_row_at_pos(gtkTreeView
, dragX
, dragY
, path
, pos
);
1810 * Creates a GdkPixmap representation of the row at path.
1811 * This image is used for a drag icon.
1815 * a GtkTreePath in tree_view
1817 * a newly-allocated pixmap of the drag icon.
1819 public Pixmap
createRowDragIcon(TreePath path
)
1821 // GdkPixmap* gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, GtkTreePath *path);
1822 return new Pixmap( gtk_tree_view_create_row_drag_icon(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct()) );
1826 * If enable_search is set, then the user can type in text to search through
1827 * the tree interactively (this is sometimes called "typeahead find").
1828 * Note that even if this is FALSE, the user can still initiate a search
1829 * using the "start-interactive-search" key binding.
1833 * TRUE, if the user can search interactively
1835 public void setEnableSearch(int enableSearch
)
1837 // void gtk_tree_view_set_enable_search (GtkTreeView *tree_view, gboolean enable_search);
1838 gtk_tree_view_set_enable_search(gtkTreeView
, enableSearch
);
1842 * Returns whether or not the tree allows to start interactive searching
1843 * by typing in text.
1847 * whether or not to let the user search interactively
1849 public int getEnableSearch()
1851 // gboolean gtk_tree_view_get_enable_search (GtkTreeView *tree_view);
1852 return gtk_tree_view_get_enable_search(gtkTreeView
);
1856 * Gets the column searched on by the interactive search code.
1860 * the column the interactive search code searches in.
1862 public int getSearchColumn()
1864 // gint gtk_tree_view_get_search_column (GtkTreeView *tree_view);
1865 return gtk_tree_view_get_search_column(gtkTreeView
);
1869 * Sets column as the column where the interactive search code should
1871 * If the sort column is set, users can use the "start-interactive-search"
1872 * key binding to bring up search popup. The enable-search property controls
1873 * whether simply typing text will also start an interactive search.
1874 * Note that column refers to a column of the model.
1878 * the column of the model to search in, or -1 to disable searching
1880 public void setSearchColumn(int column
)
1882 // void gtk_tree_view_set_search_column (GtkTreeView *tree_view, gint column);
1883 gtk_tree_view_set_search_column(gtkTreeView
, column
);
1887 * Returns the compare function currently in use.
1891 * the currently used compare function for the search code.
1893 public GtkTreeViewSearchEqualFunc
getSearchEqualFunc()
1895 // GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func (GtkTreeView *tree_view);
1896 return gtk_tree_view_get_search_equal_func(gtkTreeView
);
1900 * Sets the compare function for the interactive search capabilities; note
1901 * that somewhat like strcmp() returning 0 for equality
1902 * GtkTreeViewSearchEqualFunc returns FALSE on matches.
1905 * search_equal_func:
1906 * the compare function to use during the search
1908 * user data to pass to search_equal_func, or NULL
1910 * Destroy notifier for search_user_data, or NULL
1912 public void setSearchEqualFunc(GtkTreeViewSearchEqualFunc searchEqualFunc
, void* searchUserData
, GtkDestroyNotify searchDestroy
)
1914 // void gtk_tree_view_set_search_equal_func (GtkTreeView *tree_view, GtkTreeViewSearchEqualFunc search_equal_func, gpointer search_user_data, GtkDestroyNotify search_destroy);
1915 gtk_tree_view_set_search_equal_func(gtkTreeView
, searchEqualFunc
, searchUserData
, searchDestroy
);
1919 * Returns the GtkEntry which is currently in use as interactive search
1920 * entry for tree_view. In case the built-in entry is being used, NULL
1925 * the entry currently in use as search entry.
1928 public GtkEntry
* getSearchEntry()
1930 // GtkEntry* gtk_tree_view_get_search_entry (GtkTreeView *tree_view);
1931 return gtk_tree_view_get_search_entry(gtkTreeView
);
1935 * Sets the entry which the interactive search code will use for this
1936 * tree_view. This is useful when you want to provide a search entry
1937 * in our interface at all time at a fixed position. Passing NULL for
1938 * entry will make the interactive search code use the built-in popup
1943 * the entry the interactive search code of tree_view should use or NULL
1946 public void setSearchEntry(GtkEntry
* entry
)
1948 // void gtk_tree_view_set_search_entry (GtkTreeView *tree_view, GtkEntry *entry);
1949 gtk_tree_view_set_search_entry(gtkTreeView
, entry
);
1954 * Returns the positioning function currently in use.
1958 * the currently used function for positioning the search dialog.
1961 public GtkTreeViewSearchPositionFunc
getSearchPositionFunc()
1963 // GtkTreeViewSearchPositionFunc gtk_tree_view_get_search_position_func (GtkTreeView *tree_view);
1964 return gtk_tree_view_get_search_position_func(gtkTreeView
);
1968 * Sets the function to use when positioning the seach dialog.
1972 * the function to use to position the search dialog, or NULL
1973 * to use the default search position function
1975 * user data to pass to func, or NULL
1977 * Destroy notifier for data, or NULL
1980 public void setSearchPositionFunc(GtkTreeViewSearchPositionFunc func
, void* data
, GDestroyNotify destroy
)
1982 // void gtk_tree_view_set_search_position_func (GtkTreeView *tree_view, GtkTreeViewSearchPositionFunc func, gpointer data, GDestroyNotify destroy);
1983 gtk_tree_view_set_search_position_func(gtkTreeView
, func
, data
, destroy
);
1987 * Returns whether fixed height mode is turned on for tree_view.
1991 * TRUE if tree_view is in fixed height mode
1994 public int getFixedHeightMode()
1996 // gboolean gtk_tree_view_get_fixed_height_mode (GtkTreeView *tree_view);
1997 return gtk_tree_view_get_fixed_height_mode(gtkTreeView
);
2001 * Enables or disables the fixed height mode of tree_view.
2002 * Fixed height mode speeds up GtkTreeView by assuming that all
2003 * rows have the same height.
2004 * Only enable this option if all rows are the same height and all
2005 * columns are of type GTK_TREE_VIEW_COLUMN_FIXED.
2009 * TRUE to enable fixed height mode
2012 public void setFixedHeightMode(int enable
)
2014 // void gtk_tree_view_set_fixed_height_mode (GtkTreeView *tree_view, gboolean enable);
2015 gtk_tree_view_set_fixed_height_mode(gtkTreeView
, enable
);
2019 * Returns whether hover selection mode is turned on for tree_view.
2023 * TRUE if tree_view is in hover selection mode
2026 public int getHoverSelection()
2028 // gboolean gtk_tree_view_get_hover_selection (GtkTreeView *tree_view);
2029 return gtk_tree_view_get_hover_selection(gtkTreeView
);
2033 * Enables of disables the hover selection mode of tree_view.
2034 * Hover selection makes the selected row follow the pointer.
2035 * Currently, this works only for the selection modes
2036 * GTK_SELECTION_SINGLE and GTK_SELECTION_BROWSE.
2040 * TRUE to enable hover selection mode
2043 public void setHoverSelection(int hover
)
2045 // void gtk_tree_view_set_hover_selection (GtkTreeView *tree_view, gboolean hover);
2046 gtk_tree_view_set_hover_selection(gtkTreeView
, hover
);
2050 * Returns whether hover expansion mode is turned on for tree_view.
2054 * TRUE if tree_view is in hover expansion mode
2057 public int getHoverExpand()
2059 // gboolean gtk_tree_view_get_hover_expand (GtkTreeView *tree_view);
2060 return gtk_tree_view_get_hover_expand(gtkTreeView
);
2064 * Enables of disables the hover expansion mode of tree_view.
2065 * Hover expansion makes rows expand or collaps if the pointer
2070 * TRUE to enable hover selection mode
2073 public void setHoverExpand(int expand
)
2075 // void gtk_tree_view_set_hover_expand (GtkTreeView *tree_view, gboolean expand);
2076 gtk_tree_view_set_hover_expand(gtkTreeView
, expand
);
2081 * This function should almost never be used. It is meant for private use by
2082 * ATK for determining the number of visible children that are removed when the
2083 * user collapses a row, or a row is deleted.
2087 * Function to be called when a view row is destroyed, or NULL
2089 * User data to be passed to func, or NULL
2091 * Destroy notifier for data, or NULL
2093 public void setDestroyCountFunc(GtkTreeDestroyCountFunc func
, void* data
, GtkDestroyNotify destroy
)
2095 // void gtk_tree_view_set_destroy_count_func (GtkTreeView *tree_view, GtkTreeDestroyCountFunc func, gpointer data, GtkDestroyNotify destroy);
2096 gtk_tree_view_set_destroy_count_func(gtkTreeView
, func
, data
, destroy
);
2101 * Returns the current row separator function.
2105 * the current row separator function.
2108 public GtkTreeViewRowSeparatorFunc
getRowSeparatorFunc()
2110 // GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_separator_func (GtkTreeView *tree_view);
2111 return gtk_tree_view_get_row_separator_func(gtkTreeView
);
2115 * Sets the row separator function, which is used to determine
2116 * whether a row should be drawn as a separator. If the row separator
2117 * function is NULL, no separators are drawn. This is the default value.
2121 * a GtkTreeViewRowSeparatorFunc
2123 * user data to pass to func, or NULL
2125 * destroy notifier for data, or NULL
2128 public void setRowSeparatorFunc(GtkTreeViewRowSeparatorFunc func
, void* data
, GtkDestroyNotify destroy
)
2130 // void gtk_tree_view_set_row_separator_func (GtkTreeView *tree_view, GtkTreeViewRowSeparatorFunc func, gpointer data, GtkDestroyNotify destroy);
2131 gtk_tree_view_set_row_separator_func(gtkTreeView
, func
, data
, destroy
);
2135 * Returns whether rubber banding is turned on for tree_view. If the
2136 * selection mode is GTK_SELECTION_MULTIPLE, rubber banding will allow the
2137 * user to select multiple rows by dragging the mouse.
2141 * TRUE if rubber banding in tree_view is enabled.
2144 public int getRubberBanding()
2146 // gboolean gtk_tree_view_get_rubber_banding (GtkTreeView *tree_view);
2147 return gtk_tree_view_get_rubber_banding(gtkTreeView
);
2151 * Enables or disables rubber banding in tree_view. If the selection mode
2152 * is GTK_SELECTION_MULTIPLE, rubber banding will allow the user to select
2153 * multiple rows by dragging the mouse.
2157 * TRUE to enable rubber banding
2160 public void setRubberBanding(int enable
)
2162 // void gtk_tree_view_set_rubber_banding (GtkTreeView *tree_view, gboolean enable);
2163 gtk_tree_view_set_rubber_banding(gtkTreeView
, enable
);
2167 * Returns whether or not tree lines are drawn in tree_view.
2171 * TRUE if tree lines are drawn in tree_view, FALSE
2175 public int getEnableTreeLines()
2177 // gboolean gtk_tree_view_get_enable_tree_lines (GtkTreeView *tree_view);
2178 return gtk_tree_view_get_enable_tree_lines(gtkTreeView
);
2182 * Sets whether to draw lines interconnecting the expanders in tree_view.
2183 * This does not have any visible effects for lists.
2187 * TRUE to enable tree line drawing, FALSE otherwise.
2190 public void setEnableTreeLines(int enabled
)
2192 // void gtk_tree_view_set_enable_tree_lines (GtkTreeView *tree_view, gboolean enabled);
2193 gtk_tree_view_set_enable_tree_lines(gtkTreeView
, enabled
);
2198 * Returns which grid lines are enabled in tree_view.
2202 * a GtkTreeViewGridLines value indicating which grid lines
2206 public GtkTreeViewGridLines
getGridLines()
2208 // GtkTreeViewGridLines gtk_tree_view_get_grid_lines (GtkTreeView *tree_view);
2209 return gtk_tree_view_get_grid_lines(gtkTreeView
);
2213 * Sets which grid lines to draw in tree_view.
2217 * a GtkTreeViewGridLines value indicating which grid lines to
2221 * The "enable-grid-lines" property
2222 * "enable-grid-lines" GtkTreeViewGridLines : Read / Write
2223 * Whether grid lines should be drawn in the tree view.
2224 * Default value: GTK_TREE_VIEW_GRID_LINES_NONE
2226 public void setGridLines(GtkTreeViewGridLines gridLines
)
2228 // void gtk_tree_view_set_grid_lines (GtkTreeView *tree_view, GtkTreeViewGridLines grid_lines);
2229 gtk_tree_view_set_grid_lines(gtkTreeView
, gridLines
);