2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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
73 private import gtk
.gtktypes
;
75 private import lib
.gtk
;
77 private import glib
.Str
;
78 private import gtk
.TreeModel
;
79 private import gtk
.TreeSelection
;
80 private import gtk
.Adjustment
;
81 private import gtk
.TreeViewColumn
;
82 private import gtk
.CellRenderer
;
83 private import glib
.ListG
;
84 private import gtk
.TreePath
;
85 private import gdk
.Rectangle
;
86 private import gdk
.Window
;
87 private import gdk
.Pixmap
;
88 private import gtk
.TreeIter
;
92 * Widget that displays any object that implements the GtkTreeModel interface.
93 * Please refer to the tree widget conceptual overview
94 * for an overview of all the objects and data types related to the tree widget and how
97 private import gtk
.Container
;
98 public class TreeView
: Container
101 /** the main Gtk struct */
102 protected GtkTreeView
* gtkTreeView
;
105 public GtkTreeView
* getTreeViewStruct()
111 /** the main Gtk struct as a void* */
112 protected void* getStruct()
114 return cast(void*)gtkTreeView
;
118 * Sets our main struct and passes it to the parent class
120 public this (GtkTreeView
* gtkTreeView
)
122 super(cast(GtkContainer
*)gtkTreeView
);
123 this.gtkTreeView
= gtkTreeView
;
127 * Expands the row of the iter.
132 int expandRow(TreeIter iter
, TreeModel model
, int openAll
)
134 return expandRow(model
.getPath(iter
), openAll
);
138 * Finds the path at the point (x, y), relative to widget coordinates. That
139 * is, x and y are relative to an events coordinates. x and y must come
140 * from an event on the tree_view only where event->window ==
141 * gtk_tree_view_get_bin (). It is primarily for things
142 * like popup menus. If path is non-NULL, then it will be filled with the
143 * GtkTreePath at that point. This path should be freed with gtk_tree_path_free().
144 * If column is non-NULL, then it will be filled with the column at that point.
145 * cell_x and cell_y return the coordinates relative to the cell background
146 * (i.e. the background_area passed to gtk_cell_renderer_render()). This
147 * function is only meaningful if tree_view is realized.
151 * The x position to be identified.
153 * The y position to be identified.
155 * A pointer to a GtkTreePath pointer to be filled in, or NULL
157 * A pointer to a GtkTreeViewColumn pointer to be filled in, or NULL
159 * A pointer where the X coordinate relative to the cell can be placed, or NULL
161 * A pointer where the Y coordinate relative to the cell can be placed, or NULL
163 * TRUE if a row exists at that coordinate.
165 int getPathAtPos(gint x
, gint y
, inout TreePath path
, inout TreeViewColumn column
, out gint cellX
, out gint cellY
)
167 GtkTreePath
* p
= path
.getTreePathStruct();
168 GtkTreeViewColumn
* c
= column
.getTreeViewColumnStruct();
170 int result
= gtk_tree_view_get_path_at_pos(gtkTreeView
, x
, y
, &p
, &c
, &cellX
, &cellY
)
173 path
= new TreePath(p
);
174 column
= new TreeViewColumn(c
);
182 * gets the first selected iter or null if no rows are selected
184 TreeIter
getSelectedIter()
186 TreeIter iter
= new TreeIter();
187 TreeSelection selection
= getSelection();
188 TreeModel model
= getModel();
189 TreePath
[] paths
= selection
.getSelectedRows(model
);
190 if ( paths
.length
> 0 )
192 model
.getIter(iter
,paths
[0]);
197 TreeIter
[] getSelectedIters()
201 TreeIter iter
= new TreeIter();
202 TreeSelection selection
= getSelection();
203 TreeModel model
= getModel();
204 TreePath
[] paths
= selection
.getSelectedRows(model
);
205 foreach ( TreePath p
; selection
.getSelectedRows(model
) )
207 //iters.length = iters.length+1;
208 //iters[iters.length-1] = model.getIter(iter,p);
209 // iters ~= model.getIter(iter,p); >>> compile error can only concatenate arrays ???
210 if ( model
.getIter(iter
,p
) )
213 iter
= new TreeIter();
217 //printf("TreeView.getSelectedIters iters.lenght = %d\n", iters.length);
222 * Inserts a column and sets it's attributes
227 * @return number of columns including the new one
229 gint
insertEditableColumn(int position
, char[] title
, CellRenderer renderer
, bit editable
)
231 // OK, this is a trick because of my ignorance on how to pass variable argument lists
234 position
= getColumns().length();
236 int tot
= gtk_tree_view_insert_column_with_attributes(
239 Str
.toStringz(title
),
240 renderer
.getCellRendererStruct(),
241 Str
.toStringz("text"),position
,//v1.getV(),
242 Str
.toStringz("editable"),2,0);//v.getV(),0);
252 // imports for the signal processing
253 private import gobject
.Signals
;
254 private import gdk
.gdktypes
;
255 int[char[]] connectedSignals
;
257 void delegate(TreeView
)[] onColumnsChangedListeners
;
258 void addOnColumnsChanged(void delegate(TreeView
) dlg
)
260 if ( !("columns-changed" in connectedSignals
) )
265 cast(GCallback
)&callBackColumnsChanged
,
268 cast(ConnectFlags
)0);
269 connectedSignals
["columns-changed"] = 1;
271 onColumnsChangedListeners
~= dlg
;
273 extern(C
) static void callBackColumnsChanged(GtkTreeView
* treeViewStruct
, TreeView treeView
)
275 bit consumed
= false;
277 foreach ( void delegate(TreeView
) dlg
; treeView
.onColumnsChangedListeners
)
285 void delegate(TreeView
)[] onCursorChangedListeners
;
286 void addOnCursorChanged(void delegate(TreeView
) dlg
)
288 if ( !("cursor-changed" in connectedSignals
) )
293 cast(GCallback
)&callBackCursorChanged
,
296 cast(ConnectFlags
)0);
297 connectedSignals
["cursor-changed"] = 1;
299 onCursorChangedListeners
~= dlg
;
301 extern(C
) static void callBackCursorChanged(GtkTreeView
* treeViewStruct
, TreeView treeView
)
303 bit consumed
= false;
305 foreach ( void delegate(TreeView
) dlg
; treeView
.onCursorChangedListeners
)
313 gboolean
delegate(gboolean
, gboolean
, gboolean
, TreeView
)[] onExpandCollapseCursorRowListeners
;
314 void addOnExpandCollapseCursorRow(gboolean
delegate(gboolean
, gboolean
, gboolean
, TreeView
) dlg
)
316 if ( !("expand-collapse-cursor-row" in connectedSignals
) )
320 "expand-collapse-cursor-row",
321 cast(GCallback
)&callBackExpandCollapseCursorRow
,
324 cast(ConnectFlags
)0);
325 connectedSignals
["expand-collapse-cursor-row"] = 1;
327 onExpandCollapseCursorRowListeners
~= dlg
;
329 extern(C
) static void callBackExpandCollapseCursorRow(GtkTreeView
* treeviewStruct
, gboolean arg1
, gboolean arg2
, gboolean arg3
, TreeView treeView
)
331 bit consumed
= false;
333 foreach ( gboolean
delegate(gboolean
, gboolean
, gboolean
, TreeView
) dlg
; treeView
.onExpandCollapseCursorRowListeners
)
335 dlg(arg1
, arg2
, arg3
, treeView
);
341 gboolean
delegate(GtkMovementStep
, gint
, TreeView
)[] onMoveCursorListeners
;
342 void addOnMoveCursor(gboolean
delegate(GtkMovementStep
, gint
, TreeView
) dlg
)
344 if ( !("move-cursor" in connectedSignals
) )
349 cast(GCallback
)&callBackMoveCursor
,
352 cast(ConnectFlags
)0);
353 connectedSignals
["move-cursor"] = 1;
355 onMoveCursorListeners
~= dlg
;
357 extern(C
) static void callBackMoveCursor(GtkTreeView
* treeviewStruct
, GtkMovementStep arg1
, gint arg2
, TreeView treeView
)
359 bit consumed
= false;
361 foreach ( gboolean
delegate(GtkMovementStep
, gint
, TreeView
) dlg
; treeView
.onMoveCursorListeners
)
363 dlg(arg1
, arg2
, treeView
);
369 void delegate(TreePath
, TreeViewColumn
, TreeView
)[] onRowActivatedListeners
;
370 void addOnRowActivated(void delegate(TreePath
, TreeViewColumn
, TreeView
) dlg
)
372 if ( !("row-activated" in connectedSignals
) )
377 cast(GCallback
)&callBackRowActivated
,
380 cast(ConnectFlags
)0);
381 connectedSignals
["row-activated"] = 1;
383 onRowActivatedListeners
~= dlg
;
385 extern(C
) static void callBackRowActivated(GtkTreeView
* treeViewStruct
, GtkTreePath
* path
, GtkTreeViewColumn
* column
, TreeView treeView
)
387 bit consumed
= false;
389 foreach ( void delegate(TreePath
, TreeViewColumn
, TreeView
) dlg
; treeView
.onRowActivatedListeners
)
391 dlg(new TreePath(path
), new TreeViewColumn(column
), treeView
);
397 void delegate(GtkTreeIter
*, TreePath
, TreeView
)[] onRowCollapsedListeners
;
398 void addOnRowCollapsed(void delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
)
400 if ( !("row-collapsed" in connectedSignals
) )
405 cast(GCallback
)&callBackRowCollapsed
,
408 cast(ConnectFlags
)0);
409 connectedSignals
["row-collapsed"] = 1;
411 onRowCollapsedListeners
~= dlg
;
413 extern(C
) static void callBackRowCollapsed(GtkTreeView
* treeViewStruct
, GtkTreeIter
* iter
, GtkTreePath
* path
, TreeView treeView
)
415 bit consumed
= false;
417 foreach ( void delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
; treeView
.onRowCollapsedListeners
)
419 dlg(iter
, new TreePath(path
), treeView
);
425 void delegate(GtkTreeIter
*, TreePath
, TreeView
)[] onRowExpandedListeners
;
426 void addOnRowExpanded(void delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
)
428 if ( !("row-expanded" in connectedSignals
) )
433 cast(GCallback
)&callBackRowExpanded
,
436 cast(ConnectFlags
)0);
437 connectedSignals
["row-expanded"] = 1;
439 onRowExpandedListeners
~= dlg
;
441 extern(C
) static void callBackRowExpanded(GtkTreeView
* treeViewStruct
, GtkTreeIter
* iter
, GtkTreePath
* path
, TreeView treeView
)
443 bit consumed
= false;
445 foreach ( void delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
; treeView
.onRowExpandedListeners
)
447 dlg(iter
, new TreePath(path
), treeView
);
453 gboolean
delegate(TreeView
)[] onSelectAllListeners
;
454 void addOnSelectAll(gboolean
delegate(TreeView
) dlg
)
456 if ( !("select-all" in connectedSignals
) )
461 cast(GCallback
)&callBackSelectAll
,
464 cast(ConnectFlags
)0);
465 connectedSignals
["select-all"] = 1;
467 onSelectAllListeners
~= dlg
;
469 extern(C
) static void callBackSelectAll(GtkTreeView
* treeviewStruct
, TreeView treeView
)
471 bit consumed
= false;
473 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onSelectAllListeners
)
481 gboolean
delegate(TreeView
)[] onSelectCursorParentListeners
;
482 void addOnSelectCursorParent(gboolean
delegate(TreeView
) dlg
)
484 if ( !("select-cursor-parent" in connectedSignals
) )
488 "select-cursor-parent",
489 cast(GCallback
)&callBackSelectCursorParent
,
492 cast(ConnectFlags
)0);
493 connectedSignals
["select-cursor-parent"] = 1;
495 onSelectCursorParentListeners
~= dlg
;
497 extern(C
) static void callBackSelectCursorParent(GtkTreeView
* treeviewStruct
, TreeView treeView
)
499 bit consumed
= false;
501 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onSelectCursorParentListeners
)
509 gboolean
delegate(gboolean
, TreeView
)[] onSelectCursorRowListeners
;
510 void addOnSelectCursorRow(gboolean
delegate(gboolean
, TreeView
) dlg
)
512 if ( !("select-cursor-row" in connectedSignals
) )
517 cast(GCallback
)&callBackSelectCursorRow
,
520 cast(ConnectFlags
)0);
521 connectedSignals
["select-cursor-row"] = 1;
523 onSelectCursorRowListeners
~= dlg
;
525 extern(C
) static void callBackSelectCursorRow(GtkTreeView
* treeviewStruct
, gboolean arg1
, TreeView treeView
)
527 bit consumed
= false;
529 foreach ( gboolean
delegate(gboolean
, TreeView
) dlg
; treeView
.onSelectCursorRowListeners
)
537 void delegate(Adjustment
, Adjustment
, TreeView
)[] onSetScrollAdjustmentsListeners
;
538 void addOnSetScrollAdjustments(void delegate(Adjustment
, Adjustment
, TreeView
) dlg
)
540 if ( !("set-scroll-adjustments" in connectedSignals
) )
544 "set-scroll-adjustments",
545 cast(GCallback
)&callBackSetScrollAdjustments
,
548 cast(ConnectFlags
)0);
549 connectedSignals
["set-scroll-adjustments"] = 1;
551 onSetScrollAdjustmentsListeners
~= dlg
;
553 extern(C
) static void callBackSetScrollAdjustments(GtkTreeView
* treeviewStruct
, GtkAdjustment
* arg1
, GtkAdjustment
* arg2
, TreeView treeView
)
555 bit consumed
= false;
557 foreach ( void delegate(Adjustment
, Adjustment
, TreeView
) dlg
; treeView
.onSetScrollAdjustmentsListeners
)
559 dlg(new Adjustment(arg1
), new Adjustment(arg2
), treeView
);
565 gboolean
delegate(TreeView
)[] onStartInteractiveSearchListeners
;
566 void addOnStartInteractiveSearch(gboolean
delegate(TreeView
) dlg
)
568 if ( !("start-interactive-search" in connectedSignals
) )
572 "start-interactive-search",
573 cast(GCallback
)&callBackStartInteractiveSearch
,
576 cast(ConnectFlags
)0);
577 connectedSignals
["start-interactive-search"] = 1;
579 onStartInteractiveSearchListeners
~= dlg
;
581 extern(C
) static void callBackStartInteractiveSearch(GtkTreeView
* treeviewStruct
, TreeView treeView
)
583 bit consumed
= false;
585 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onStartInteractiveSearchListeners
)
593 gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
)[] onTestCollapseRowListeners
;
594 void addOnTestCollapseRow(gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
)
596 if ( !("test-collapse-row" in connectedSignals
) )
601 cast(GCallback
)&callBackTestCollapseRow
,
604 cast(ConnectFlags
)0);
605 connectedSignals
["test-collapse-row"] = 1;
607 onTestCollapseRowListeners
~= dlg
;
609 extern(C
) static void callBackTestCollapseRow(GtkTreeView
* treeViewStruct
, GtkTreeIter
* iter
, GtkTreePath
* path
, TreeView treeView
)
611 bit consumed
= false;
613 foreach ( gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
; treeView
.onTestCollapseRowListeners
)
615 dlg(iter
, new TreePath(path
), treeView
);
621 gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
)[] onTestExpandRowListeners
;
622 void addOnTestExpandRow(gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
)
624 if ( !("test-expand-row" in connectedSignals
) )
629 cast(GCallback
)&callBackTestExpandRow
,
632 cast(ConnectFlags
)0);
633 connectedSignals
["test-expand-row"] = 1;
635 onTestExpandRowListeners
~= dlg
;
637 extern(C
) static void callBackTestExpandRow(GtkTreeView
* treeViewStruct
, GtkTreeIter
* iter
, GtkTreePath
* path
, TreeView treeView
)
639 bit consumed
= false;
641 foreach ( gboolean
delegate(GtkTreeIter
*, TreePath
, TreeView
) dlg
; treeView
.onTestExpandRowListeners
)
643 dlg(iter
, new TreePath(path
), treeView
);
649 gboolean
delegate(TreeView
)[] onToggleCursorRowListeners
;
650 void addOnToggleCursorRow(gboolean
delegate(TreeView
) dlg
)
652 if ( !("toggle-cursor-row" in connectedSignals
) )
657 cast(GCallback
)&callBackToggleCursorRow
,
660 cast(ConnectFlags
)0);
661 connectedSignals
["toggle-cursor-row"] = 1;
663 onToggleCursorRowListeners
~= dlg
;
665 extern(C
) static void callBackToggleCursorRow(GtkTreeView
* treeviewStruct
, TreeView treeView
)
667 bit consumed
= false;
669 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onToggleCursorRowListeners
)
677 gboolean
delegate(TreeView
)[] onUnselectAllListeners
;
678 void addOnUnselectAll(gboolean
delegate(TreeView
) dlg
)
680 if ( !("unselect-all" in connectedSignals
) )
685 cast(GCallback
)&callBackUnselectAll
,
688 cast(ConnectFlags
)0);
689 connectedSignals
["unselect-all"] = 1;
691 onUnselectAllListeners
~= dlg
;
693 extern(C
) static void callBackUnselectAll(GtkTreeView
* treeviewStruct
, TreeView treeView
)
695 bit consumed
= false;
697 foreach ( gboolean
delegate(TreeView
) dlg
; treeView
.onUnselectAllListeners
)
713 * Creates a new GtkTreeView widget.
715 * A newly created GtkTreeView widget.
719 // GtkWidget* gtk_tree_view_new (void);
720 this(cast(GtkTreeView
*)gtk_tree_view_new() );
724 * Creates a new GtkTreeView widget with the model initialized to model.
728 * A newly created GtkTreeView widget.
730 public this (TreeModel model
)
732 // GtkWidget* gtk_tree_view_new_with_model (GtkTreeModel *model);
733 this(cast(GtkTreeView
*)gtk_tree_view_new_with_model((model
is null) ?
null : model
.getTreeModelStruct()) );
737 * Returns the model the GtkTreeView is based on. Returns NULL if the
742 * A GtkTreeModel, or NULL if none is currently being used.
744 public TreeModel
getModel()
746 // GtkTreeModel* gtk_tree_view_get_model (GtkTreeView *tree_view);
747 return new TreeModel( gtk_tree_view_get_model(gtkTreeView
) );
751 * Sets the model for a GtkTreeView. If the tree_view already has a model
752 * set, it will remove it before setting the new model. If model is NULL,
753 * then it will unset the old model.
759 public void setModel(TreeModel model
)
761 // void gtk_tree_view_set_model (GtkTreeView *tree_view, GtkTreeModel *model);
762 gtk_tree_view_set_model(gtkTreeView
, (model
is null) ?
null : model
.getTreeModelStruct());
766 * Gets the GtkTreeSelection associated with tree_view.
770 * A GtkTreeSelection object.
772 public TreeSelection
getSelection()
774 // GtkTreeSelection* gtk_tree_view_get_selection (GtkTreeView *tree_view);
775 return new TreeSelection( gtk_tree_view_get_selection(gtkTreeView
) );
779 * Gets the GtkAdjustment currently being used for the horizontal aspect.
783 * A GtkAdjustment object, or NULL if none is currently being
786 public Adjustment
getHadjustment()
788 // GtkAdjustment* gtk_tree_view_get_hadjustment (GtkTreeView *tree_view);
789 return new Adjustment( gtk_tree_view_get_hadjustment(gtkTreeView
) );
793 * Sets the GtkAdjustment for the current horizontal aspect.
797 * The GtkAdjustment to set, or NULL
799 public void setHadjustment(Adjustment adjustment
)
801 // void gtk_tree_view_set_hadjustment (GtkTreeView *tree_view, GtkAdjustment *adjustment);
802 gtk_tree_view_set_hadjustment(gtkTreeView
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());
806 * Gets the GtkAdjustment currently being used for the vertical aspect.
810 * A GtkAdjustment object, or NULL if none is currently being
813 public Adjustment
getVadjustment()
815 // GtkAdjustment* gtk_tree_view_get_vadjustment (GtkTreeView *tree_view);
816 return new Adjustment( gtk_tree_view_get_vadjustment(gtkTreeView
) );
820 * Sets the GtkAdjustment for the current vertical aspect.
824 * The GtkAdjustment to set, or NULL
826 public void setVadjustment(Adjustment adjustment
)
828 // void gtk_tree_view_set_vadjustment (GtkTreeView *tree_view, GtkAdjustment *adjustment);
829 gtk_tree_view_set_vadjustment(gtkTreeView
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());
833 * Returns TRUE if the headers on the tree_view are visible.
837 * Whether the headers are visible or not.
839 public int getHeadersVisible()
841 // gboolean gtk_tree_view_get_headers_visible (GtkTreeView *tree_view);
842 return gtk_tree_view_get_headers_visible(gtkTreeView
);
846 * Sets the visibility state of the headers.
850 * TRUE if the headers are visible
852 public void setHeadersVisible(int headersVisible
)
854 // void gtk_tree_view_set_headers_visible (GtkTreeView *tree_view, gboolean headers_visible);
855 gtk_tree_view_set_headers_visible(gtkTreeView
, headersVisible
);
859 * Resizes all columns to their optimal width. Only works after the
860 * treeview has been realized.
864 public void columnsAutosize()
866 // void gtk_tree_view_columns_autosize (GtkTreeView *tree_view);
867 gtk_tree_view_columns_autosize(gtkTreeView
);
871 * Returns whether all header columns are clickable.
875 * TRUE if all header columns are clickable, otherwise FALSE
878 public int getHeadersClickable()
880 // gboolean gtk_tree_view_get_headers_clickable (GtkTreeView *tree_view);
881 return gtk_tree_view_get_headers_clickable(gtkTreeView
);
885 * Allow the column title buttons to be clicked.
889 * TRUE if the columns are clickable.
891 public void setHeadersClickable(int setting
)
893 // void gtk_tree_view_set_headers_clickable (GtkTreeView *tree_view, gboolean setting);
894 gtk_tree_view_set_headers_clickable(gtkTreeView
, setting
);
898 * This function tells GTK+ that the user interface for your
899 * application requires users to read across tree rows and associate
900 * cells with one another. By default, GTK+ will then render the tree
901 * with alternating row colors. Do not use it
902 * just because you prefer the appearance of the ruled tree; that's a
903 * question for the theme. Some themes will draw tree rows in
904 * alternating colors even when rules are turned off, and users who
905 * prefer that appearance all the time can choose those themes. You
906 * should call this function only as a semantic
907 * hint to the theme engine that your tree makes alternating colors
908 * useful from a functional standpoint (since it has lots of columns,
913 * TRUE if the tree requires reading across rows
915 public void setRulesHint(int setting
)
917 // void gtk_tree_view_set_rules_hint (GtkTreeView *tree_view, gboolean setting);
918 gtk_tree_view_set_rules_hint(gtkTreeView
, setting
);
922 * Gets the setting set by gtk_tree_view_set_rules_hint().
926 * TRUE if rules are useful for the user of this tree
928 public int getRulesHint()
930 // gboolean gtk_tree_view_get_rules_hint (GtkTreeView *tree_view);
931 return gtk_tree_view_get_rules_hint(gtkTreeView
);
935 * Appends column to the list of columns. If tree_view has "fixed_height"
936 * mode enabled, then column must have its "sizing" property set to be
937 * GTK_TREE_VIEW_COLUMN_FIXED.
941 * The GtkTreeViewColumn to add.
943 * The number of columns in tree_view after appending.
945 public int appendColumn(TreeViewColumn column
)
947 // gint gtk_tree_view_append_column (GtkTreeView *tree_view, GtkTreeViewColumn *column);
948 return gtk_tree_view_append_column(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct());
952 * Removes column from tree_view.
956 * The GtkTreeViewColumn to remove.
958 * The number of columns in tree_view after removing.
960 public int removeColumn(TreeViewColumn column
)
962 // gint gtk_tree_view_remove_column (GtkTreeView *tree_view, GtkTreeViewColumn *column);
963 return gtk_tree_view_remove_column(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct());
967 * This inserts the column into the tree_view at position. If position is
968 * -1, then the column is inserted at the end. If tree_view has
969 * "fixed_height" mode enabled, then column must have its "sizing" property
970 * set to be GTK_TREE_VIEW_COLUMN_FIXED.
974 * The GtkTreeViewColumn to be inserted.
976 * The position to insert column in.
978 * The number of columns in tree_view after insertion.
980 public int insertColumn(TreeViewColumn column
, int position
)
982 // gint gtk_tree_view_insert_column (GtkTreeView *tree_view, GtkTreeViewColumn *column, gint position);
983 return gtk_tree_view_insert_column(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct(), position
);
987 * Creates a new GtkTreeViewColumn and inserts it into the tree_view at
988 * position. If position is -1, then the newly created column is inserted at
989 * the end. The column is initialized with the attributes given. If tree_view
990 * has "fixed_height" mode enabled, then the new column will have its sizing
991 * property set to be GTK_TREE_VIEW_COLUMN_FIXED.
995 * The position to insert the new column in.
997 * The title to set the header to.
999 * The GtkCellRenderer.
1001 * A NULL-terminated list of attributes.
1003 * The number of columns in tree_view after insertion.
1005 public int insertColumnWithAttributes(int position
, char[] title
, CellRenderer cell
, ... )
1007 // gint gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view, gint position, const gchar *title, GtkCellRenderer *cell, ...);
1008 return gtk_tree_view_insert_column_with_attributes(gtkTreeView
, position
, Str
.toStringz(title
), (cell
is null) ?
null : cell
.getCellRendererStruct());
1012 * Convenience function that inserts a new column into the GtkTreeView
1013 * with the given cell renderer and a GtkCellDataFunc to set cell renderer
1014 * attributes (normally using data from the model). See also
1015 * gtk_tree_view_column_set_cell_data_func(), gtk_tree_view_column_pack_start().
1016 * If tree_view has "fixed_height" mode enabled, then the new column will have its
1017 * "sizing" property set to be GTK_TREE_VIEW_COLUMN_FIXED.
1021 * Position to insert, -1 for append
1025 * cell renderer for column
1027 * function to set attributes of cell renderer
1031 * destroy notifier for data
1033 * number of columns in the tree view post-insert
1035 public int insertColumnWithDataFunc(int position
, char[] title
, CellRenderer cell
, GtkTreeCellDataFunc func
, void* data
, GDestroyNotify dnotify
)
1037 // 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);
1038 return gtk_tree_view_insert_column_with_data_func(gtkTreeView
, position
, Str
.toStringz(title
), (cell
is null) ?
null : cell
.getCellRendererStruct(), func
, data
, dnotify
);
1042 * Gets the GtkTreeViewColumn at the given position in the tree_view.
1046 * The position of the column, counting from 0.
1048 * The GtkTreeViewColumn, or NULL if the position is outside the
1051 public TreeViewColumn
getColumn(int n
)
1053 // GtkTreeViewColumn* gtk_tree_view_get_column (GtkTreeView *tree_view, gint n);
1054 return new TreeViewColumn( gtk_tree_view_get_column(gtkTreeView
, n
) );
1058 * Returns a GList of all the GtkTreeViewColumn s currently in tree_view.
1059 * The returned list must be freed with g_list_free().
1063 * A list of GtkTreeViewColumn s
1065 public ListG
getColumns()
1067 // GList* gtk_tree_view_get_columns (GtkTreeView *tree_view);
1068 return new ListG( gtk_tree_view_get_columns(gtkTreeView
) );
1072 * Moves column to be after to base_column. If base_column is NULL, then
1073 * column is placed in the first position.
1077 * The GtkTreeViewColumn to be moved.
1079 * The GtkTreeViewColumn to be moved relative to, or NULL.
1081 public void moveColumnAfter(TreeViewColumn column
, TreeViewColumn baseColumn
)
1083 // void gtk_tree_view_move_column_after (GtkTreeView *tree_view, GtkTreeViewColumn *column, GtkTreeViewColumn *base_column);
1084 gtk_tree_view_move_column_after(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct(), (baseColumn
is null) ?
null : baseColumn
.getTreeViewColumnStruct());
1088 * Sets the column to draw the expander arrow at. It must be in tree_view.
1089 * If column is NULL, then the expander arrow is always at the first
1091 * If you do not want expander arrow to appear in your tree, set the
1092 * expander column to a hidden column.
1096 * NULL, or the column to draw the expander arrow at.
1098 public void setExpanderColumn(TreeViewColumn column
)
1100 // void gtk_tree_view_set_expander_column (GtkTreeView *tree_view, GtkTreeViewColumn *column);
1101 gtk_tree_view_set_expander_column(gtkTreeView
, (column
is null) ?
null : column
.getTreeViewColumnStruct());
1105 * Returns the column that is the current expander column. This
1106 * column has the expander arrow drawn next to it.
1110 * The expander column.
1112 public TreeViewColumn
getExpanderColumn()
1114 // GtkTreeViewColumn* gtk_tree_view_get_expander_column (GtkTreeView *tree_view);
1115 return new TreeViewColumn( gtk_tree_view_get_expander_column(gtkTreeView
) );
1119 * Sets a user function for determining where a column may be dropped when
1120 * dragged. This function is called on every column pair in turn at the
1121 * beginning of a column drag to determine where a drop can take place. The
1122 * arguments passed to func are: the tree_view, the GtkTreeViewColumn being
1123 * dragged, the two GtkTreeViewColumn s determining the drop spot, and
1124 * user_data. If either of the GtkTreeViewColumn arguments for the drop spot
1125 * are NULL, then they indicate an edge. If func is set to be NULL, then
1126 * tree_view reverts to the default behavior of allowing all columns to be
1127 * dropped everywhere.
1131 * A function to determine which columns are reorderable, or NULL.
1133 * User data to be passed to func, or NULL
1135 * Destroy notifier for user_data, or NULL
1137 public void setColumnDragFunction(GtkTreeViewColumnDropFunc func
, void* userData
, GtkDestroyNotify destroy
)
1139 // void gtk_tree_view_set_column_drag_function (GtkTreeView *tree_view, GtkTreeViewColumnDropFunc func, gpointer user_data, GtkDestroyNotify destroy);
1140 gtk_tree_view_set_column_drag_function(gtkTreeView
, func
, userData
, destroy
);
1144 * Scrolls the tree view such that the top-left corner of the visible
1145 * area is tree_x, tree_y, where tree_x and tree_y are specified
1146 * in tree window coordinates. The tree_view must be realized before
1147 * this function is called. If it isn't, you probably want to be
1148 * using gtk_tree_view_scroll_to_cell().
1149 * If either tree_x or tree_y are -1, then that direction isn't scrolled.
1153 * X coordinate of new top-left pixel of visible area, or -1
1155 * Y coordinate of new top-left pixel of visible area, or -1
1157 public void scrollToPoint(int treeX
, int treeY
)
1159 // void gtk_tree_view_scroll_to_point (GtkTreeView *tree_view, gint tree_x, gint tree_y);
1160 gtk_tree_view_scroll_to_point(gtkTreeView
, treeX
, treeY
);
1164 * Moves the alignments of tree_view to the position specified by column and
1165 * path. If column is NULL, then no horizontal scrolling occurs. Likewise,
1166 * if path is NULL no vertical scrolling occurs. At a minimum, one of column
1167 * or path need to be non-NULL. row_align determines where the row is
1168 * placed, and col_align determines where column is placed. Both are expected
1169 * to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means
1170 * right/bottom alignment, 0.5 means center.
1171 * If use_align is FALSE, then the alignment arguments are ignored, and the
1172 * tree does the minimum amount of work to scroll the cell onto the screen.
1173 * This means that the cell will be scrolled to the edge closest to its current
1174 * position. If the cell is currently visible on the screen, nothing is done.
1175 * This function only works if the model is set, and path is a valid row on the
1176 * model. If the model changes before the tree_view is realized, the centered
1177 * path will be modified to reflect this change.
1181 * The path of the row to move to, or NULL.
1183 * The GtkTreeViewColumn to move horizontally to, or NULL.
1185 * whether to use alignment arguments, or FALSE.
1187 * The vertical alignment of the row specified by path.
1189 * The horizontal alignment of the column specified by column.
1191 public void scrollToCell(TreePath path
, TreeViewColumn column
, int useAlign
, float rowAlign
, float colAlign
)
1193 // void gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gboolean use_align, gfloat row_align, gfloat col_align);
1194 gtk_tree_view_scroll_to_cell(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (column
is null) ?
null : column
.getTreeViewColumnStruct(), useAlign
, rowAlign
, colAlign
);
1198 * Sets the current keyboard focus to be at path, and selects it. This is
1199 * useful when you want to focus the user's attention on a particular row. If
1200 * focus_column is not NULL, then focus is given to the column specified by
1201 * it. Additionally, if focus_column is specified, and start_editing is
1202 * TRUE, then editing should be started in the specified cell.
1203 * This function is often followed by gtk_widget_grab_focus (tree_view)
1204 * in order to give keyboard focus to the widget. Please note that editing
1205 * can only happen when the widget is realized.
1211 * A GtkTreeViewColumn, or NULL
1213 * TRUE if the specified cell should start being edited.
1215 public void setCursor(TreePath path
, TreeViewColumn focusColumn
, int startEditing
)
1217 // void gtk_tree_view_set_cursor (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *focus_column, gboolean start_editing);
1218 gtk_tree_view_set_cursor(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (focusColumn
is null) ?
null : focusColumn
.getTreeViewColumnStruct(), startEditing
);
1222 * Sets the current keyboard focus to be at path, and selects it. This is
1223 * useful when you want to focus the user's attention on a particular row. If
1224 * focus_column is not NULL, then focus is given to the column specified by
1225 * it. If focus_column and focus_cell are not NULL, and focus_column
1226 * contains 2 or more editable or activatable cells, then focus is given to
1227 * the cell specified by focus_cell. Additionally, if focus_column is
1228 * specified, and start_editing is TRUE, then editing should be started in
1229 * the specified cell. This function is often followed by
1230 * gtk_widget_grab_focus (tree_view) in order to give keyboard focus to the
1231 * widget. Please note that editing can only happen when the widget is
1238 * A GtkTreeViewColumn, or NULL
1240 * A GtkCellRenderer, or NULL
1242 * TRUE if the specified cell should start being edited.
1245 public void setCursorOnCell(TreePath path
, TreeViewColumn focusColumn
, CellRenderer focusCell
, int startEditing
)
1247 // void gtk_tree_view_set_cursor_on_cell (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *focus_column, GtkCellRenderer *focus_cell, gboolean start_editing);
1248 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
);
1252 * Fills in path and focus_column with the current path and focus column. If
1253 * the cursor isn't currently set, then *path will be NULL. If no column
1254 * currently has focus, then *focus_column will be NULL.
1255 * The returned GtkTreePath must be freed with gtk_tree_path_free() when
1256 * you are done with it.
1260 * A pointer to be filled with the current cursor path, or NULL
1262 * A pointer to be filled with the current focus column, or NULL
1264 public void getCursor(GtkTreePath
** path
, GtkTreeViewColumn
** focusColumn
)
1266 // void gtk_tree_view_get_cursor (GtkTreeView *tree_view, GtkTreePath **path, GtkTreeViewColumn **focus_column);
1267 gtk_tree_view_get_cursor(gtkTreeView
, path
, focusColumn
);
1271 * Activates the cell determined by path and column.
1275 * The GtkTreePath to be activated.
1277 * The GtkTreeViewColumn to be activated.
1279 public void rowActivated(TreePath path
, TreeViewColumn column
)
1281 // void gtk_tree_view_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column);
1282 gtk_tree_view_row_activated(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), (column
is null) ?
null : column
.getTreeViewColumnStruct());
1286 * Recursively expands all nodes in the tree_view.
1290 public void expandAll()
1292 // void gtk_tree_view_expand_all (GtkTreeView *tree_view);
1293 gtk_tree_view_expand_all(gtkTreeView
);
1297 * Recursively collapses all visible, expanded nodes in tree_view.
1301 public void collapseAll()
1303 // void gtk_tree_view_collapse_all (GtkTreeView *tree_view);
1304 gtk_tree_view_collapse_all(gtkTreeView
);
1308 * Expands the row at path. This will also expand all parent rows of
1309 * path as necessary.
1316 public void expandToPath(TreePath path
)
1318 // void gtk_tree_view_expand_to_path (GtkTreeView *tree_view, GtkTreePath *path);
1319 gtk_tree_view_expand_to_path(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct());
1323 * Opens the row so its children are visible.
1329 * whether to recursively expand, or just expand immediate children
1331 * TRUE if the row existed and had children
1333 public int expandRow(TreePath path
, int openAll
)
1335 // gboolean gtk_tree_view_expand_row (GtkTreeView *tree_view, GtkTreePath *path, gboolean open_all);
1336 return gtk_tree_view_expand_row(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), openAll
);
1340 * Collapses a row (hides its child rows, if they exist).
1344 * path to a row in the tree_view
1346 * TRUE if the row was collapsed.
1348 public int collapseRow(TreePath path
)
1350 // gboolean gtk_tree_view_collapse_row (GtkTreeView *tree_view, GtkTreePath *path);
1351 return gtk_tree_view_collapse_row(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct());
1355 * Calls func on all expanded rows.
1359 * A function to be called
1361 * User data to be passed to the function.
1363 public void mapExpandedRows(GtkTreeViewMappingFunc func
, void* data
)
1365 // void gtk_tree_view_map_expanded_rows (GtkTreeView *tree_view, GtkTreeViewMappingFunc func, gpointer data);
1366 gtk_tree_view_map_expanded_rows(gtkTreeView
, func
, data
);
1370 * Returns TRUE if the node pointed to by path is expanded in tree_view.
1374 * A GtkTreePath to test expansion state.
1376 * TRUE if path is expanded.
1378 public int rowExpanded(TreePath path
)
1380 // gboolean gtk_tree_view_row_expanded (GtkTreeView *tree_view, GtkTreePath *path);
1381 return gtk_tree_view_row_expanded(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct());
1385 * This function is a convenience function to allow you to reorder models that
1386 * support the GtkDragSourceIface and the GtkDragDestIface. Both
1387 * GtkTreeStore and GtkListStore support these. If reorderable is TRUE, then
1388 * the user can reorder the model by dragging and dropping rows. The
1389 * developer can listen to these changes by connecting to the model's
1390 * row_inserted and row_deleted signals.
1391 * This function does not give you any degree of control over the order -- any
1392 * reordering is allowed. If more control is needed, you should probably
1393 * handle drag and drop manually.
1397 * TRUE, if the tree can be reordered.
1399 public void setReorderable(int reorderable
)
1401 // void gtk_tree_view_set_reorderable (GtkTreeView *tree_view, gboolean reorderable);
1402 gtk_tree_view_set_reorderable(gtkTreeView
, reorderable
);
1406 * Retrieves whether the user can reorder the tree via drag-and-drop. See
1407 * gtk_tree_view_set_reorderable().
1411 * TRUE if the tree can be reordered.
1413 public int getReorderable()
1415 // gboolean gtk_tree_view_get_reorderable (GtkTreeView *tree_view);
1416 return gtk_tree_view_get_reorderable(gtkTreeView
);
1420 * Finds the path at the point (x, y), relative to widget coordinates. That
1421 * is, x and y are relative to an events coordinates. x and y must come
1422 * from an event on the tree_view only where event->window ==
1423 * gtk_tree_view_get_bin (). It is primarily for things
1424 * like popup menus. If path is non-NULL, then it will be filled with the
1425 * GtkTreePath at that point. This path should be freed with gtk_tree_path_free().
1426 * If column is non-NULL, then it will be filled with the column at that point.
1427 * cell_x and cell_y return the coordinates relative to the cell background
1428 * (i.e. the background_area passed to gtk_cell_renderer_render()). This
1429 * function is only meaningful if tree_view is realized.
1433 * The x position to be identified.
1435 * The y position to be identified.
1437 * A pointer to a GtkTreePath pointer to be filled in, or NULL
1439 * A pointer to a GtkTreeViewColumn pointer to be filled in, or NULL
1441 * A pointer where the X coordinate relative to the cell can be placed, or NULL
1443 * A pointer where the Y coordinate relative to the cell can be placed, or NULL
1445 * TRUE if a row exists at that coordinate.
1447 public int getPathAtPos(int x
, int y
, GtkTreePath
** path
, GtkTreeViewColumn
** column
, int* cellX
, int* cellY
)
1449 // 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);
1450 return gtk_tree_view_get_path_at_pos(gtkTreeView
, x
, y
, path
, column
, cellX
, cellY
);
1454 * Fills the bounding rectangle in tree window coordinates for the cell at the
1455 * row specified by path and the column specified by column. If path is
1456 * NULL, or points to a path not currently displayed, the y and height fields
1457 * of the rectangle will be filled with 0. If column is NULL, the x and width
1458 * fields will be filled with 0. The sum of all cell rects does not cover the
1459 * entire tree; there are extra pixels in between rows, for example. The
1460 * returned rectangle is equivalent to the cell_area passed to
1461 * gtk_cell_renderer_render(). This function is only valid if tree_view is
1466 * a GtkTreePath for the row, or NULL to get only horizontal coordinates
1468 * a GtkTreeViewColumn for the column, or NULL to get only vertical coordinates
1470 * rectangle to fill with cell rect
1472 public void getCellArea(TreePath path
, TreeViewColumn column
, Rectangle rect
)
1474 // void gtk_tree_view_get_cell_area (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, GdkRectangle *rect);
1475 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());
1479 * Fills the bounding rectangle in tree window coordinates for the cell at the
1480 * row specified by path and the column specified by column. If path is
1481 * NULL, or points to a node not found in the tree, the y and height fields of
1482 * the rectangle will be filled with 0. If column is NULL, the x and width
1483 * fields will be filled with 0. The returned rectangle is equivalent to the
1484 * background_area passed to gtk_cell_renderer_render(). These background
1485 * areas tile to cover the entire tree window (except for the area used for
1486 * header buttons). Contrast with the cell_area, returned by
1487 * gtk_tree_view_get_cell_area(), which returns only the cell itself, excluding
1488 * surrounding borders and the tree expander area.
1492 * a GtkTreePath for the row, or NULL to get only horizontal coordinates
1494 * a GtkTreeViewColumn for the column, or NULL to get only vertical coordiantes
1496 * rectangle to fill with cell background rect
1498 public void getBackgroundArea(TreePath path
, TreeViewColumn column
, Rectangle rect
)
1500 // void gtk_tree_view_get_background_area (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, GdkRectangle *rect);
1501 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());
1505 * Fills visible_rect with the currently-visible region of the
1506 * buffer, in tree coordinates. Convert to widget coordinates with
1507 * gtk_tree_view_tree_to_widget_coords(). Tree coordinates start at
1508 * 0,0 for row 0 of the tree, and cover the entire scrollable area of
1515 public void getVisibleRect(Rectangle visibleRect
)
1517 // void gtk_tree_view_get_visible_rect (GtkTreeView *tree_view, GdkRectangle *visible_rect);
1518 gtk_tree_view_get_visible_rect(gtkTreeView
, (visibleRect
is null) ?
null : visibleRect
.getRectangleStruct());
1522 * Sets start_path and end_path to be the first and last visible path.
1523 * Note that there may be invisible paths in between.
1524 * The paths should be freed with gtk_tree_path_free() after use.
1528 * Return location for start of region, or NULL.
1530 * Return location for end of region, or NULL.
1532 * TRUE, if valid paths were placed in start_path and end_path.
1535 public int getVisibleRange(GtkTreePath
** startPath
, GtkTreePath
** endPath
)
1537 // gboolean gtk_tree_view_get_visible_range (GtkTreeView *tree_view, GtkTreePath **start_path, GtkTreePath **end_path);
1538 return gtk_tree_view_get_visible_range(gtkTreeView
, startPath
, endPath
);
1542 * Returns the window that tree_view renders to. This is used primarily to
1543 * compare to event->window to confirm that the event on
1544 * tree_view is on the right window.
1548 * A GdkWindow, or NULL when tree_view hasn't been realized yet
1550 public Window
getBinWindow()
1552 // GdkWindow* gtk_tree_view_get_bin_window (GtkTreeView *tree_view);
1553 return new Window( gtk_tree_view_get_bin_window(gtkTreeView
) );
1557 * Converts widget coordinates to coordinates for the
1558 * tree window (the full scrollable area of the tree).
1562 * widget X coordinate
1564 * widget Y coordinate
1566 * return location for tree X coordinate
1568 * return location for tree Y coordinate
1570 public void widgetToTreeCoords(int wx
, int wy
, int* tx
, int* ty
)
1572 // void gtk_tree_view_widget_to_tree_coords (GtkTreeView *tree_view, gint wx, gint wy, gint *tx, gint *ty);
1573 gtk_tree_view_widget_to_tree_coords(gtkTreeView
, wx
, wy
, tx
, ty
);
1577 * Converts tree coordinates (coordinates in full scrollable area of the tree)
1578 * to widget coordinates.
1586 * return location for widget X coordinate
1588 * return location for widget Y coordinate
1590 public void treeToWidgetCoords(int tx
, int ty
, int* wx
, int* wy
)
1592 // void gtk_tree_view_tree_to_widget_coords (GtkTreeView *tree_view, gint tx, gint ty, gint *wx, gint *wy);
1593 gtk_tree_view_tree_to_widget_coords(gtkTreeView
, tx
, ty
, wx
, wy
);
1597 * Turns tree_view into a drop destination for automatic DND.
1601 * the table of targets that the drag will support
1603 * the number of items in targets
1605 * the bitmask of possible actions for a drag from this
1608 public void enableModelDragDest(GtkTargetEntry
* targets
, int nTargets
, GdkDragAction actions
)
1610 // void gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view, const GtkTargetEntry *targets, gint n_targets, GdkDragAction actions);
1611 gtk_tree_view_enable_model_drag_dest(gtkTreeView
, targets
, nTargets
, actions
);
1615 * Turns tree_view into a drag source for automatic DND.
1618 * start_button_mask:
1619 * Mask of allowed buttons to start drag
1621 * the table of targets that the drag will support
1623 * the number of items in targets
1625 * the bitmask of possible actions for a drag from this
1628 public void enableModelDragSource(GdkModifierType startButtonMask
, GtkTargetEntry
* targets
, int nTargets
, GdkDragAction actions
)
1630 // void gtk_tree_view_enable_model_drag_source (GtkTreeView *tree_view, GdkModifierType start_button_mask, const GtkTargetEntry *targets, gint n_targets, GdkDragAction actions);
1631 gtk_tree_view_enable_model_drag_source(gtkTreeView
, startButtonMask
, targets
, nTargets
, actions
);
1635 * Undoes the effect of gtk_tree_view_enable_model_drag_source().
1639 public void unsetRowsDragSource()
1641 // void gtk_tree_view_unset_rows_drag_source (GtkTreeView *tree_view);
1642 gtk_tree_view_unset_rows_drag_source(gtkTreeView
);
1646 * Undoes the effect of gtk_tree_view_enable_model_drag_dest().
1650 public void unsetRowsDragDest()
1652 // void gtk_tree_view_unset_rows_drag_dest (GtkTreeView *tree_view);
1653 gtk_tree_view_unset_rows_drag_dest(gtkTreeView
);
1657 * Sets the row that is highlighted for feedback.
1661 * The path of the row to highlight, or NULL.
1663 * Specifies whether to drop before, after or into the row
1665 public void setDragDestRow(TreePath path
, GtkTreeViewDropPosition pos
)
1667 // void gtk_tree_view_set_drag_dest_row (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewDropPosition pos);
1668 gtk_tree_view_set_drag_dest_row(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct(), pos
);
1672 * Gets information about the row that is highlighted for feedback.
1676 * Return location for the path of the highlighted row, or NULL.
1678 * Return location for the drop position, or NULL
1680 public void getDragDestRow(GtkTreePath
** path
, GtkTreeViewDropPosition
* pos
)
1682 // void gtk_tree_view_get_drag_dest_row (GtkTreeView *tree_view, GtkTreePath **path, GtkTreeViewDropPosition *pos);
1683 gtk_tree_view_get_drag_dest_row(gtkTreeView
, path
, pos
);
1687 * Determines the destination row for a given position.
1691 * the position to determine the destination row for
1693 * the position to determine the destination row for
1695 * Return location for the path of the highlighted row, or NULL.
1697 * Return location for the drop position, or NULL
1699 * whether there is a row at the given position.
1701 public int getDestRowAtPos(int dragX
, int dragY
, GtkTreePath
** path
, GtkTreeViewDropPosition
* pos
)
1703 // gboolean gtk_tree_view_get_dest_row_at_pos (GtkTreeView *tree_view, gint drag_x, gint drag_y, GtkTreePath **path, GtkTreeViewDropPosition *pos);
1704 return gtk_tree_view_get_dest_row_at_pos(gtkTreeView
, dragX
, dragY
, path
, pos
);
1708 * Creates a GdkPixmap representation of the row at path.
1709 * This image is used for a drag icon.
1713 * a GtkTreePath in tree_view
1715 * a newly-allocated pixmap of the drag icon.
1717 public Pixmap
createRowDragIcon(TreePath path
)
1719 // GdkPixmap* gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, GtkTreePath *path);
1720 return new Pixmap( gtk_tree_view_create_row_drag_icon(gtkTreeView
, (path
is null) ?
null : path
.getTreePathStruct()) );
1724 * If enable_search is set, then the user can type in text to search through
1725 * the tree interactively (this is sometimes called "typeahead find").
1726 * Note that even if this is FALSE, the user can still initiate a search
1727 * using the "start-interactive-search" key binding.
1731 * TRUE, if the user can search interactively
1733 public void setEnableSearch(int enableSearch
)
1735 // void gtk_tree_view_set_enable_search (GtkTreeView *tree_view, gboolean enable_search);
1736 gtk_tree_view_set_enable_search(gtkTreeView
, enableSearch
);
1740 * Returns whether or not the tree allows to start interactive searching
1741 * by typing in text.
1745 * whether or not to let the user search interactively
1747 public int getEnableSearch()
1749 // gboolean gtk_tree_view_get_enable_search (GtkTreeView *tree_view);
1750 return gtk_tree_view_get_enable_search(gtkTreeView
);
1754 * Gets the column searched on by the interactive search code.
1758 * the column the interactive search code searches in.
1760 public int getSearchColumn()
1762 // gint gtk_tree_view_get_search_column (GtkTreeView *tree_view);
1763 return gtk_tree_view_get_search_column(gtkTreeView
);
1767 * Sets column as the column where the interactive search code should
1769 * If the sort column is set, users can use the "start-interactive-search"
1770 * key binding to bring up search popup. The enable-search property controls
1771 * whether simply typing text will also start an interactive search.
1772 * Note that column refers to a column of the model.
1776 * the column of the model to search in, or -1 to disable searching
1778 public void setSearchColumn(int column
)
1780 // void gtk_tree_view_set_search_column (GtkTreeView *tree_view, gint column);
1781 gtk_tree_view_set_search_column(gtkTreeView
, column
);
1785 * Returns the compare function currently in use.
1789 * the currently used compare function for the search code.
1791 public GtkTreeViewSearchEqualFunc
getSearchEqualFunc()
1793 // GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func (GtkTreeView *tree_view);
1794 return gtk_tree_view_get_search_equal_func(gtkTreeView
);
1798 * Sets the compare function for the interactive search capabilities; note
1799 * that somewhat like strcmp() returning 0 for equality
1800 * GtkTreeViewSearchEqualFunc returns FALSE on matches.
1803 * search_equal_func:
1804 * the compare function to use during the search
1806 * user data to pass to search_equal_func, or NULL
1808 * Destroy notifier for search_user_data, or NULL
1810 public void setSearchEqualFunc(GtkTreeViewSearchEqualFunc searchEqualFunc
, void* searchUserData
, GtkDestroyNotify searchDestroy
)
1812 // void gtk_tree_view_set_search_equal_func (GtkTreeView *tree_view, GtkTreeViewSearchEqualFunc search_equal_func, gpointer search_user_data, GtkDestroyNotify search_destroy);
1813 gtk_tree_view_set_search_equal_func(gtkTreeView
, searchEqualFunc
, searchUserData
, searchDestroy
);
1817 * Returns the GtkEntry which is currently in use as interactive search
1818 * entry for tree_view. In case the built-in entry is being used, NULL
1823 * the entry currently in use as search entry.
1826 public GtkEntry
* getSearchEntry()
1828 // GtkEntry* gtk_tree_view_get_search_entry (GtkTreeView *tree_view);
1829 return gtk_tree_view_get_search_entry(gtkTreeView
);
1833 * Sets the entry which the interactive search code will use for this
1834 * tree_view. This is useful when you want to provide a search entry
1835 * in our interface at all time at a fixed position. Passing NULL for
1836 * entry will make the interactive search code use the built-in popup
1841 * the entry the interactive search code of tree_view should use or NULL
1844 public void setSearchEntry(GtkEntry
* entry
)
1846 // void gtk_tree_view_set_search_entry (GtkTreeView *tree_view, GtkEntry *entry);
1847 gtk_tree_view_set_search_entry(gtkTreeView
, entry
);
1852 * Returns the positioning function currently in use.
1856 * the currently used function for positioning the search dialog.
1859 public GtkTreeViewSearchPositionFunc
getSearchPositionFunc()
1861 // GtkTreeViewSearchPositionFunc gtk_tree_view_get_search_position_func (GtkTreeView *tree_view);
1862 return gtk_tree_view_get_search_position_func(gtkTreeView
);
1866 * Sets the function to use when positioning the seach dialog.
1870 * the function to use to position the search dialog, or NULL
1871 * to use the default search position function
1873 * user data to pass to func, or NULL
1875 * Destroy notifier for data, or NULL
1878 public void setSearchPositionFunc(GtkTreeViewSearchPositionFunc func
, void* data
, GDestroyNotify destroy
)
1880 // void gtk_tree_view_set_search_position_func (GtkTreeView *tree_view, GtkTreeViewSearchPositionFunc func, gpointer data, GDestroyNotify destroy);
1881 gtk_tree_view_set_search_position_func(gtkTreeView
, func
, data
, destroy
);
1885 * Returns whether fixed height mode is turned on for tree_view.
1889 * TRUE if tree_view is in fixed height mode
1892 public int getFixedHeightMode()
1894 // gboolean gtk_tree_view_get_fixed_height_mode (GtkTreeView *tree_view);
1895 return gtk_tree_view_get_fixed_height_mode(gtkTreeView
);
1899 * Enables or disables the fixed height mode of tree_view.
1900 * Fixed height mode speeds up GtkTreeView by assuming that all
1901 * rows have the same height.
1902 * Only enable this option if all rows are the same height and all
1903 * columns are of type GTK_TREE_VIEW_COLUMN_FIXED.
1907 * TRUE to enable fixed height mode
1910 public void setFixedHeightMode(int enable
)
1912 // void gtk_tree_view_set_fixed_height_mode (GtkTreeView *tree_view, gboolean enable);
1913 gtk_tree_view_set_fixed_height_mode(gtkTreeView
, enable
);
1917 * Returns whether hover selection mode is turned on for tree_view.
1921 * TRUE if tree_view is in hover selection mode
1924 public int getHoverSelection()
1926 // gboolean gtk_tree_view_get_hover_selection (GtkTreeView *tree_view);
1927 return gtk_tree_view_get_hover_selection(gtkTreeView
);
1931 * Enables of disables the hover selection mode of tree_view.
1932 * Hover selection makes the selected row follow the pointer.
1933 * Currently, this works only for the selection modes
1934 * GTK_SELECTION_SINGLE and GTK_SELECTION_BROWSE.
1938 * TRUE to enable hover selection mode
1941 public void setHoverSelection(int hover
)
1943 // void gtk_tree_view_set_hover_selection (GtkTreeView *tree_view, gboolean hover);
1944 gtk_tree_view_set_hover_selection(gtkTreeView
, hover
);
1948 * Returns whether hover expansion mode is turned on for tree_view.
1952 * TRUE if tree_view is in hover expansion mode
1955 public int getHoverExpand()
1957 // gboolean gtk_tree_view_get_hover_expand (GtkTreeView *tree_view);
1958 return gtk_tree_view_get_hover_expand(gtkTreeView
);
1962 * Enables of disables the hover expansion mode of tree_view.
1963 * Hover expansion makes rows expand or collaps if the pointer
1968 * TRUE to enable hover selection mode
1971 public void setHoverExpand(int expand
)
1973 // void gtk_tree_view_set_hover_expand (GtkTreeView *tree_view, gboolean expand);
1974 gtk_tree_view_set_hover_expand(gtkTreeView
, expand
);
1979 * This function should almost never be used. It is meant for private use by
1980 * ATK for determining the number of visible children that are removed when the
1981 * user collapses a row, or a row is deleted.
1985 * Function to be called when a view row is destroyed, or NULL
1987 * User data to be passed to func, or NULL
1989 * Destroy notifier for data, or NULL
1991 public void setDestroyCountFunc(GtkTreeDestroyCountFunc func
, void* data
, GtkDestroyNotify destroy
)
1993 // void gtk_tree_view_set_destroy_count_func (GtkTreeView *tree_view, GtkTreeDestroyCountFunc func, gpointer data, GtkDestroyNotify destroy);
1994 gtk_tree_view_set_destroy_count_func(gtkTreeView
, func
, data
, destroy
);
1999 * Returns the current row separator function.
2003 * the current row separator function.
2006 public GtkTreeViewRowSeparatorFunc
getRowSeparatorFunc()
2008 // GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_separator_func (GtkTreeView *tree_view);
2009 return gtk_tree_view_get_row_separator_func(gtkTreeView
);
2013 * Sets the row separator function, which is used to determine
2014 * whether a row should be drawn as a separator. If the row separator
2015 * function is NULL, no separators are drawn. This is the default value.
2019 * a GtkTreeViewRowSeparatorFunc
2021 * user data to pass to func, or NULL
2023 * destroy notifier for data, or NULL
2026 public void setRowSeparatorFunc(GtkTreeViewRowSeparatorFunc func
, void* data
, GtkDestroyNotify destroy
)
2028 // void gtk_tree_view_set_row_separator_func (GtkTreeView *tree_view, GtkTreeViewRowSeparatorFunc func, gpointer data, GtkDestroyNotify destroy);
2029 gtk_tree_view_set_row_separator_func(gtkTreeView
, func
, data
, destroy
);
2033 * Returns whether rubber banding is turned on for tree_view. If the
2034 * selection mode is GTK_SELECTION_MULTIPLE, rubber banding will allow the
2035 * user to select multiple rows by dragging the mouse.
2039 * TRUE if rubber banding in tree_view is enabled.
2042 public int getRubberBanding()
2044 // gboolean gtk_tree_view_get_rubber_banding (GtkTreeView *tree_view);
2045 return gtk_tree_view_get_rubber_banding(gtkTreeView
);
2049 * Enables or disables rubber banding in tree_view. If the selection mode
2050 * is GTK_SELECTION_MULTIPLE, rubber banding will allow the user to select
2051 * multiple rows by dragging the mouse.
2055 * TRUE to enable rubber banding
2058 public void setRubberBanding(int enable
)
2060 // void gtk_tree_view_set_rubber_banding (GtkTreeView *tree_view, gboolean enable);
2061 gtk_tree_view_set_rubber_banding(gtkTreeView
, enable
);
2065 * Returns whether or not tree lines are drawn in tree_view.
2069 * TRUE if tree lines are drawn in tree_view, FALSE
2073 public int getEnableTreeLines()
2075 // gboolean gtk_tree_view_get_enable_tree_lines (GtkTreeView *tree_view);
2076 return gtk_tree_view_get_enable_tree_lines(gtkTreeView
);
2080 * Sets whether to draw lines interconnecting the expanders in tree_view.
2081 * This does not have any visible effects for lists.
2085 * TRUE to enable tree line drawing, FALSE otherwise.
2088 public void setEnableTreeLines(int enabled
)
2090 // void gtk_tree_view_set_enable_tree_lines (GtkTreeView *tree_view, gboolean enabled);
2091 gtk_tree_view_set_enable_tree_lines(gtkTreeView
, enabled
);
2096 * Returns which grid lines are enabled in tree_view.
2100 * a GtkTreeViewGridLines value indicating which grid lines
2104 public GtkTreeViewGridLines
getGridLines()
2106 // GtkTreeViewGridLines gtk_tree_view_get_grid_lines (GtkTreeView *tree_view);
2107 return gtk_tree_view_get_grid_lines(gtkTreeView
);
2111 * Sets which grid lines to draw in tree_view.
2115 * a GtkTreeViewGridLines value indicating which grid lines to
2119 * The "enable-grid-lines" property
2120 * "enable-grid-lines" GtkTreeViewGridLines : Read / Write
2121 * Whether grid lines should be drawn in the tree view.
2122 * Default value: GTK_TREE_VIEW_GRID_LINES_NONE
2124 public void setGridLines(GtkTreeViewGridLines gridLines
)
2126 // void gtk_tree_view_set_grid_lines (GtkTreeView *tree_view, GtkTreeViewGridLines grid_lines);
2127 gtk_tree_view_set_grid_lines(gtkTreeView
, gridLines
);