1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gtk.TreeView; 26 27 private import cairo.Surface; 28 private import gdk.Window; 29 private import glib.ConstructionException; 30 private import glib.ListG; 31 private import glib.MemorySlice; 32 private import glib.Str; 33 private import gobject.ObjectG; 34 private import gobject.Signals; 35 private import gtk.CellRenderer; 36 private import gtk.Container; 37 private import gtk.Entry; 38 private import gtk.ScrollableIF; 39 private import gtk.ScrollableT; 40 private import gtk.TargetEntry; 41 private import gtk.Tooltip; 42 private import gtk.TreeIter; 43 private import gtk.TreeModelIF; 44 private import gtk.TreePath; 45 private import gtk.TreeSelection; 46 private import gtk.TreeViewColumn; 47 private import gtk.Widget; 48 private import gtk.c.functions; 49 public import gtk.c.types; 50 public import gtkc.gtktypes; 51 private import std.algorithm; 52 53 54 /** 55 * Widget that displays any object that implements the #GtkTreeModel interface. 56 * 57 * Please refer to the 58 * [tree widget conceptual overview][TreeWidget] 59 * for an overview of all the objects and data types related 60 * to the tree widget and how they work together. 61 * 62 * Several different coordinate systems are exposed in the GtkTreeView API. 63 * These are: 64 * 65 * ![](tree-view-coordinates.png) 66 * 67 * Coordinate systems in GtkTreeView API: 68 * 69 * - Widget coordinates: Coordinates relative to the widget (usually `widget->window`). 70 * 71 * - Bin window coordinates: Coordinates relative to the window that GtkTreeView renders to. 72 * 73 * - Tree coordinates: Coordinates relative to the entire scrollable area of GtkTreeView. These 74 * coordinates start at (0, 0) for row 0 of the tree. 75 * 76 * Several functions are available for converting between the different 77 * coordinate systems. The most common translations are between widget and bin 78 * window coordinates and between bin window and tree coordinates. For the 79 * former you can use gtk_tree_view_convert_widget_to_bin_window_coords() 80 * (and vice versa), for the latter gtk_tree_view_convert_bin_window_to_tree_coords() 81 * (and vice versa). 82 * 83 * # GtkTreeView as GtkBuildable 84 * 85 * The GtkTreeView implementation of the GtkBuildable interface accepts 86 * #GtkTreeViewColumn objects as <child> elements and exposes the internal 87 * #GtkTreeSelection in UI definitions. 88 * 89 * An example of a UI definition fragment with GtkTreeView: 90 * |[ 91 * <object class="GtkTreeView" id="treeview"> 92 * <property name="model">liststore1</property> 93 * <child> 94 * <object class="GtkTreeViewColumn" id="test-column"> 95 * <property name="title">Test</property> 96 * <child> 97 * <object class="GtkCellRendererText" id="test-renderer"/> 98 * <attributes> 99 * <attribute name="text">1</attribute> 100 * </attributes> 101 * </child> 102 * </object> 103 * </child> 104 * <child internal-child="selection"> 105 * <object class="GtkTreeSelection" id="selection"> 106 * <signal name="changed" handler="on_treeview_selection_changed"/> 107 * </object> 108 * </child> 109 * </object> 110 * ]| 111 * 112 * # CSS nodes 113 * 114 * |[<!-- language="plain" --> 115 * treeview.view 116 * ├── header 117 * │ ├── <column header> 118 * ┊ ┊ 119 * │ ╰── <column header> 120 * │ 121 * ╰── [rubberband] 122 * ]| 123 * 124 * GtkTreeView has a main CSS node with name treeview and style class .view. 125 * It has a subnode with name header, which is the parent for all the column 126 * header widgets' CSS nodes. 127 * For rubberband selection, a subnode with name rubberband is used. 128 */ 129 public class TreeView : Container, ScrollableIF 130 { 131 /** the main Gtk struct */ 132 protected GtkTreeView* gtkTreeView; 133 134 /** Get the main Gtk struct */ 135 public GtkTreeView* getTreeViewStruct(bool transferOwnership = false) 136 { 137 if (transferOwnership) 138 ownedRef = false; 139 return gtkTreeView; 140 } 141 142 /** the main Gtk struct as a void* */ 143 protected override void* getStruct() 144 { 145 return cast(void*)gtkTreeView; 146 } 147 148 /** 149 * Sets our main struct and passes it to the parent class. 150 */ 151 public this (GtkTreeView* gtkTreeView, bool ownedRef = false) 152 { 153 this.gtkTreeView = gtkTreeView; 154 super(cast(GtkContainer*)gtkTreeView, ownedRef); 155 } 156 157 // add the Scrollable capabilities 158 mixin ScrollableT!(GtkTreeView); 159 160 /** 161 * Expands the row of the iter. 162 * Params: 163 * iter = 164 * openAll = 165 * Returns = 166 */ 167 int expandRow(TreeIter iter, TreeModelIF model, bool openAll) 168 { 169 return expandRow(model.getPath(iter), openAll); 170 } 171 172 /** 173 * gets the first selected iter or null if no rows are selected 174 */ 175 TreeIter getSelectedIter() 176 { 177 TreeIter iter = null; 178 TreeSelection selection = getSelection(); 179 TreeModelIF model = getModel(); 180 TreePath[] paths = selection.getSelectedRows(model); 181 if ( paths.length > 0 ) 182 { 183 iter = new TreeIter(); 184 model.getIter(iter,paths[0]); 185 } 186 return iter; 187 } 188 189 /** */ 190 TreeIter[] getSelectedIters() 191 { 192 TreeIter[] iters; 193 194 TreeIter iter = new TreeIter(); 195 TreeSelection selection = getSelection(); 196 TreeModelIF model = getModel(); 197 TreePath[] paths = selection.getSelectedRows(model); 198 foreach ( TreePath p; selection.getSelectedRows(model) ) 199 { 200 if ( model.getIter(iter,p) ) 201 { 202 iters ~= iter; 203 iter = new TreeIter(); 204 } 205 } 206 207 return iters; 208 } 209 210 /** 211 * Inserts a column and sets it's attributes 212 * Params: 213 * position = 214 * title = 215 * renderer = 216 * editable = 217 * Returns: number of columns including the new one 218 */ 219 int insertEditableColumn(int position, string title, CellRenderer renderer, bool editable) 220 { 221 // OK, this is a trick because of my ignorance on how to pass variable argument lists 222 if ( position < 0 ) 223 { 224 position = getColumns().length(); 225 } 226 int tot = gtk_tree_view_insert_column_with_attributes( 227 gtkTreeView, 228 position, 229 Str.toStringz(title), 230 renderer.getCellRendererStruct(), 231 Str.toStringz("text"),position, 232 Str.toStringz("editable"),2,0); 233 return tot; 234 } 235 236 /** 237 */ 238 239 /** */ 240 public static GType getType() 241 { 242 return gtk_tree_view_get_type(); 243 } 244 245 /** 246 * Creates a new #GtkTreeView widget. 247 * 248 * Returns: A newly created #GtkTreeView widget. 249 * 250 * Throws: ConstructionException GTK+ fails to create the object. 251 */ 252 public this() 253 { 254 auto p = gtk_tree_view_new(); 255 256 if(p is null) 257 { 258 throw new ConstructionException("null returned by new"); 259 } 260 261 this(cast(GtkTreeView*) p); 262 } 263 264 /** 265 * Creates a new #GtkTreeView widget with the model initialized to @model. 266 * 267 * Params: 268 * model = the model. 269 * 270 * Returns: A newly created #GtkTreeView widget. 271 * 272 * Throws: ConstructionException GTK+ fails to create the object. 273 */ 274 public this(TreeModelIF model) 275 { 276 auto p = gtk_tree_view_new_with_model((model is null) ? null : model.getTreeModelStruct()); 277 278 if(p is null) 279 { 280 throw new ConstructionException("null returned by new_with_model"); 281 } 282 283 this(cast(GtkTreeView*) p); 284 } 285 286 /** 287 * Appends @column to the list of columns. If @tree_view has “fixed_height” 288 * mode enabled, then @column must have its “sizing” property set to be 289 * GTK_TREE_VIEW_COLUMN_FIXED. 290 * 291 * Params: 292 * column = The #GtkTreeViewColumn to add. 293 * 294 * Returns: The number of columns in @tree_view after appending. 295 */ 296 public int appendColumn(TreeViewColumn column) 297 { 298 return gtk_tree_view_append_column(gtkTreeView, (column is null) ? null : column.getTreeViewColumnStruct()); 299 } 300 301 /** 302 * Recursively collapses all visible, expanded nodes in @tree_view. 303 */ 304 public void collapseAll() 305 { 306 gtk_tree_view_collapse_all(gtkTreeView); 307 } 308 309 /** 310 * Collapses a row (hides its child rows, if they exist). 311 * 312 * Params: 313 * path = path to a row in the @tree_view 314 * 315 * Returns: %TRUE if the row was collapsed. 316 */ 317 public bool collapseRow(TreePath path) 318 { 319 return gtk_tree_view_collapse_row(gtkTreeView, (path is null) ? null : path.getTreePathStruct()) != 0; 320 } 321 322 /** 323 * Resizes all columns to their optimal width. Only works after the 324 * treeview has been realized. 325 */ 326 public void columnsAutosize() 327 { 328 gtk_tree_view_columns_autosize(gtkTreeView); 329 } 330 331 /** 332 * Converts bin_window coordinates to coordinates for the 333 * tree (the full scrollable area of the tree). 334 * 335 * Params: 336 * bx = X coordinate relative to bin_window 337 * by = Y coordinate relative to bin_window 338 * tx = return location for tree X coordinate 339 * ty = return location for tree Y coordinate 340 * 341 * Since: 2.12 342 */ 343 public void convertBinWindowToTreeCoords(int bx, int by, out int tx, out int ty) 344 { 345 gtk_tree_view_convert_bin_window_to_tree_coords(gtkTreeView, bx, by, &tx, &ty); 346 } 347 348 /** 349 * Converts bin_window coordinates (see gtk_tree_view_get_bin_window()) 350 * to widget relative coordinates. 351 * 352 * Params: 353 * bx = bin_window X coordinate 354 * by = bin_window Y coordinate 355 * wx = return location for widget X coordinate 356 * wy = return location for widget Y coordinate 357 * 358 * Since: 2.12 359 */ 360 public void convertBinWindowToWidgetCoords(int bx, int by, out int wx, out int wy) 361 { 362 gtk_tree_view_convert_bin_window_to_widget_coords(gtkTreeView, bx, by, &wx, &wy); 363 } 364 365 /** 366 * Converts tree coordinates (coordinates in full scrollable area of the tree) 367 * to bin_window coordinates. 368 * 369 * Params: 370 * tx = tree X coordinate 371 * ty = tree Y coordinate 372 * bx = return location for X coordinate relative to bin_window 373 * by = return location for Y coordinate relative to bin_window 374 * 375 * Since: 2.12 376 */ 377 public void convertTreeToBinWindowCoords(int tx, int ty, out int bx, out int by) 378 { 379 gtk_tree_view_convert_tree_to_bin_window_coords(gtkTreeView, tx, ty, &bx, &by); 380 } 381 382 /** 383 * Converts tree coordinates (coordinates in full scrollable area of the tree) 384 * to widget coordinates. 385 * 386 * Params: 387 * tx = X coordinate relative to the tree 388 * ty = Y coordinate relative to the tree 389 * wx = return location for widget X coordinate 390 * wy = return location for widget Y coordinate 391 * 392 * Since: 2.12 393 */ 394 public void convertTreeToWidgetCoords(int tx, int ty, out int wx, out int wy) 395 { 396 gtk_tree_view_convert_tree_to_widget_coords(gtkTreeView, tx, ty, &wx, &wy); 397 } 398 399 /** 400 * Converts widget coordinates to coordinates for the bin_window 401 * (see gtk_tree_view_get_bin_window()). 402 * 403 * Params: 404 * wx = X coordinate relative to the widget 405 * wy = Y coordinate relative to the widget 406 * bx = return location for bin_window X coordinate 407 * by = return location for bin_window Y coordinate 408 * 409 * Since: 2.12 410 */ 411 public void convertWidgetToBinWindowCoords(int wx, int wy, out int bx, out int by) 412 { 413 gtk_tree_view_convert_widget_to_bin_window_coords(gtkTreeView, wx, wy, &bx, &by); 414 } 415 416 /** 417 * Converts widget coordinates to coordinates for the 418 * tree (the full scrollable area of the tree). 419 * 420 * Params: 421 * wx = X coordinate relative to the widget 422 * wy = Y coordinate relative to the widget 423 * tx = return location for tree X coordinate 424 * ty = return location for tree Y coordinate 425 * 426 * Since: 2.12 427 */ 428 public void convertWidgetToTreeCoords(int wx, int wy, out int tx, out int ty) 429 { 430 gtk_tree_view_convert_widget_to_tree_coords(gtkTreeView, wx, wy, &tx, &ty); 431 } 432 433 /** 434 * Creates a #cairo_surface_t representation of the row at @path. 435 * This image is used for a drag icon. 436 * 437 * Params: 438 * path = a #GtkTreePath in @tree_view 439 * 440 * Returns: a newly-allocated surface of the drag icon. 441 */ 442 public Surface createRowDragIcon(TreePath path) 443 { 444 auto p = gtk_tree_view_create_row_drag_icon(gtkTreeView, (path is null) ? null : path.getTreePathStruct()); 445 446 if(p is null) 447 { 448 return null; 449 } 450 451 return new Surface(cast(cairo_surface_t*) p); 452 } 453 454 /** 455 * Turns @tree_view into a drop destination for automatic DND. Calling 456 * this method sets #GtkTreeView:reorderable to %FALSE. 457 * 458 * Params: 459 * targets = the table of targets that 460 * the drag will support 461 * actions = the bitmask of possible actions for a drag from this 462 * widget 463 */ 464 public void enableModelDragDest(TargetEntry[] targets, GdkDragAction actions) 465 { 466 GtkTargetEntry[] targetsArray = new GtkTargetEntry[targets.length]; 467 for ( int i = 0; i < targets.length; i++ ) 468 { 469 targetsArray[i] = *(targets[i].getTargetEntryStruct()); 470 } 471 472 gtk_tree_view_enable_model_drag_dest(gtkTreeView, targetsArray.ptr, cast(int)targets.length, actions); 473 } 474 475 /** 476 * Turns @tree_view into a drag source for automatic DND. Calling this 477 * method sets #GtkTreeView:reorderable to %FALSE. 478 * 479 * Params: 480 * startButtonMask = Mask of allowed buttons to start drag 481 * targets = the table of targets that the drag will support 482 * actions = the bitmask of possible actions for a drag from this 483 * widget 484 */ 485 public void enableModelDragSource(GdkModifierType startButtonMask, TargetEntry[] targets, GdkDragAction actions) 486 { 487 GtkTargetEntry[] targetsArray = new GtkTargetEntry[targets.length]; 488 for ( int i = 0; i < targets.length; i++ ) 489 { 490 targetsArray[i] = *(targets[i].getTargetEntryStruct()); 491 } 492 493 gtk_tree_view_enable_model_drag_source(gtkTreeView, startButtonMask, targetsArray.ptr, cast(int)targets.length, actions); 494 } 495 496 /** 497 * Recursively expands all nodes in the @tree_view. 498 */ 499 public void expandAll() 500 { 501 gtk_tree_view_expand_all(gtkTreeView); 502 } 503 504 /** 505 * Opens the row so its children are visible. 506 * 507 * Params: 508 * path = path to a row 509 * openAll = whether to recursively expand, or just expand immediate children 510 * 511 * Returns: %TRUE if the row existed and had children 512 */ 513 public bool expandRow(TreePath path, bool openAll) 514 { 515 return gtk_tree_view_expand_row(gtkTreeView, (path is null) ? null : path.getTreePathStruct(), openAll) != 0; 516 } 517 518 /** 519 * Expands the row at @path. This will also expand all parent rows of 520 * @path as necessary. 521 * 522 * Params: 523 * path = path to a row. 524 * 525 * Since: 2.2 526 */ 527 public void expandToPath(TreePath path) 528 { 529 gtk_tree_view_expand_to_path(gtkTreeView, (path is null) ? null : path.getTreePathStruct()); 530 } 531 532 /** 533 * Gets the setting set by gtk_tree_view_set_activate_on_single_click(). 534 * 535 * Returns: %TRUE if row-activated will be emitted on a single click 536 * 537 * Since: 3.8 538 */ 539 public bool getActivateOnSingleClick() 540 { 541 return gtk_tree_view_get_activate_on_single_click(gtkTreeView) != 0; 542 } 543 544 /** 545 * Fills the bounding rectangle in bin_window coordinates for the cell at the 546 * row specified by @path and the column specified by @column. If @path is 547 * %NULL, or points to a node not found in the tree, the @y and @height fields of 548 * the rectangle will be filled with 0. If @column is %NULL, the @x and @width 549 * fields will be filled with 0. The returned rectangle is equivalent to the 550 * @background_area passed to gtk_cell_renderer_render(). These background 551 * areas tile to cover the entire bin window. Contrast with the @cell_area, 552 * returned by gtk_tree_view_get_cell_area(), which returns only the cell 553 * itself, excluding surrounding borders and the tree expander area. 554 * 555 * Params: 556 * path = a #GtkTreePath for the row, or %NULL to get only horizontal coordinates 557 * column = a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordiantes 558 * rect = rectangle to fill with cell background rect 559 */ 560 public void getBackgroundArea(TreePath path, TreeViewColumn column, out GdkRectangle rect) 561 { 562 gtk_tree_view_get_background_area(gtkTreeView, (path is null) ? null : path.getTreePathStruct(), (column is null) ? null : column.getTreeViewColumnStruct(), &rect); 563 } 564 565 /** 566 * Returns the window that @tree_view renders to. 567 * This is used primarily to compare to `event->window` 568 * to confirm that the event on @tree_view is on the right window. 569 * 570 * Returns: A #GdkWindow, or %NULL when @tree_view 571 * hasn’t been realized yet. 572 */ 573 public Window getBinWindow() 574 { 575 auto p = gtk_tree_view_get_bin_window(gtkTreeView); 576 577 if(p is null) 578 { 579 return null; 580 } 581 582 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 583 } 584 585 /** 586 * Fills the bounding rectangle in bin_window coordinates for the cell at the 587 * row specified by @path and the column specified by @column. If @path is 588 * %NULL, or points to a path not currently displayed, the @y and @height fields 589 * of the rectangle will be filled with 0. If @column is %NULL, the @x and @width 590 * fields will be filled with 0. The sum of all cell rects does not cover the 591 * entire tree; there are extra pixels in between rows, for example. The 592 * returned rectangle is equivalent to the @cell_area passed to 593 * gtk_cell_renderer_render(). This function is only valid if @tree_view is 594 * realized. 595 * 596 * Params: 597 * path = a #GtkTreePath for the row, or %NULL to get only horizontal coordinates 598 * column = a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordinates 599 * rect = rectangle to fill with cell rect 600 */ 601 public void getCellArea(TreePath path, TreeViewColumn column, out GdkRectangle rect) 602 { 603 gtk_tree_view_get_cell_area(gtkTreeView, (path is null) ? null : path.getTreePathStruct(), (column is null) ? null : column.getTreeViewColumnStruct(), &rect); 604 } 605 606 /** 607 * Gets the #GtkTreeViewColumn at the given position in the #tree_view. 608 * 609 * Params: 610 * n = The position of the column, counting from 0. 611 * 612 * Returns: The #GtkTreeViewColumn, or %NULL if the 613 * position is outside the range of columns. 614 */ 615 public TreeViewColumn getColumn(int n) 616 { 617 auto p = gtk_tree_view_get_column(gtkTreeView, n); 618 619 if(p is null) 620 { 621 return null; 622 } 623 624 return ObjectG.getDObject!(TreeViewColumn)(cast(GtkTreeViewColumn*) p); 625 } 626 627 /** 628 * Returns a #GList of all the #GtkTreeViewColumn s currently in @tree_view. 629 * The returned list must be freed with g_list_free (). 630 * 631 * Returns: A list of #GtkTreeViewColumn s 632 */ 633 public ListG getColumns() 634 { 635 auto p = gtk_tree_view_get_columns(gtkTreeView); 636 637 if(p is null) 638 { 639 return null; 640 } 641 642 return new ListG(cast(GList*) p); 643 } 644 645 /** 646 * Fills in @path and @focus_column with the current path and focus column. If 647 * the cursor isn’t currently set, then *@path will be %NULL. If no column 648 * currently has focus, then *@focus_column will be %NULL. 649 * 650 * The returned #GtkTreePath must be freed with gtk_tree_path_free() when 651 * you are done with it. 652 * 653 * Params: 654 * path = A pointer to be 655 * filled with the current cursor path, or %NULL 656 * focusColumn = A 657 * pointer to be filled with the current focus column, or %NULL 658 */ 659 public void getCursor(out TreePath path, out TreeViewColumn focusColumn) 660 { 661 GtkTreePath* outpath = null; 662 GtkTreeViewColumn* outfocusColumn = null; 663 664 gtk_tree_view_get_cursor(gtkTreeView, &outpath, &outfocusColumn); 665 666 path = ObjectG.getDObject!(TreePath)(outpath); 667 focusColumn = ObjectG.getDObject!(TreeViewColumn)(outfocusColumn); 668 } 669 670 /** 671 * Determines the destination row for a given position. @drag_x and 672 * @drag_y are expected to be in widget coordinates. This function is only 673 * meaningful if @tree_view is realized. Therefore this function will always 674 * return %FALSE if @tree_view is not realized or does not have a model. 675 * 676 * Params: 677 * dragX = the position to determine the destination row for 678 * dragY = the position to determine the destination row for 679 * path = Return location for the path of 680 * the highlighted row, or %NULL. 681 * pos = Return location for the drop position, or 682 * %NULL 683 * 684 * Returns: whether there is a row at the given position, %TRUE if this 685 * is indeed the case. 686 */ 687 public bool getDestRowAtPos(int dragX, int dragY, out TreePath path, out GtkTreeViewDropPosition pos) 688 { 689 GtkTreePath* outpath = null; 690 691 auto p = gtk_tree_view_get_dest_row_at_pos(gtkTreeView, dragX, dragY, &outpath, &pos) != 0; 692 693 path = ObjectG.getDObject!(TreePath)(outpath); 694 695 return p; 696 } 697 698 /** 699 * Gets information about the row that is highlighted for feedback. 700 * 701 * Params: 702 * path = Return location for the path of the highlighted row, or %NULL. 703 * pos = Return location for the drop position, or %NULL 704 */ 705 public void getDragDestRow(out TreePath path, out GtkTreeViewDropPosition pos) 706 { 707 GtkTreePath* outpath = null; 708 709 gtk_tree_view_get_drag_dest_row(gtkTreeView, &outpath, &pos); 710 711 path = ObjectG.getDObject!(TreePath)(outpath); 712 } 713 714 /** 715 * Returns whether or not the tree allows to start interactive searching 716 * by typing in text. 717 * 718 * Returns: whether or not to let the user search interactively 719 */ 720 public bool getEnableSearch() 721 { 722 return gtk_tree_view_get_enable_search(gtkTreeView) != 0; 723 } 724 725 /** 726 * Returns whether or not tree lines are drawn in @tree_view. 727 * 728 * Returns: %TRUE if tree lines are drawn in @tree_view, %FALSE 729 * otherwise. 730 * 731 * Since: 2.10 732 */ 733 public bool getEnableTreeLines() 734 { 735 return gtk_tree_view_get_enable_tree_lines(gtkTreeView) != 0; 736 } 737 738 /** 739 * Returns the column that is the current expander column. 740 * This column has the expander arrow drawn next to it. 741 * 742 * Returns: The expander column. 743 */ 744 public TreeViewColumn getExpanderColumn() 745 { 746 auto p = gtk_tree_view_get_expander_column(gtkTreeView); 747 748 if(p is null) 749 { 750 return null; 751 } 752 753 return ObjectG.getDObject!(TreeViewColumn)(cast(GtkTreeViewColumn*) p); 754 } 755 756 /** 757 * Returns whether fixed height mode is turned on for @tree_view. 758 * 759 * Returns: %TRUE if @tree_view is in fixed height mode 760 * 761 * Since: 2.6 762 */ 763 public bool getFixedHeightMode() 764 { 765 return gtk_tree_view_get_fixed_height_mode(gtkTreeView) != 0; 766 } 767 768 /** 769 * Returns which grid lines are enabled in @tree_view. 770 * 771 * Returns: a #GtkTreeViewGridLines value indicating which grid lines 772 * are enabled. 773 * 774 * Since: 2.10 775 */ 776 public GtkTreeViewGridLines getGridLines() 777 { 778 return gtk_tree_view_get_grid_lines(gtkTreeView); 779 } 780 781 /** 782 * Returns whether all header columns are clickable. 783 * 784 * Returns: %TRUE if all header columns are clickable, otherwise %FALSE 785 * 786 * Since: 2.10 787 */ 788 public bool getHeadersClickable() 789 { 790 return gtk_tree_view_get_headers_clickable(gtkTreeView) != 0; 791 } 792 793 /** 794 * Returns %TRUE if the headers on the @tree_view are visible. 795 * 796 * Returns: Whether the headers are visible or not. 797 */ 798 public bool getHeadersVisible() 799 { 800 return gtk_tree_view_get_headers_visible(gtkTreeView) != 0; 801 } 802 803 /** 804 * Returns whether hover expansion mode is turned on for @tree_view. 805 * 806 * Returns: %TRUE if @tree_view is in hover expansion mode 807 * 808 * Since: 2.6 809 */ 810 public bool getHoverExpand() 811 { 812 return gtk_tree_view_get_hover_expand(gtkTreeView) != 0; 813 } 814 815 /** 816 * Returns whether hover selection mode is turned on for @tree_view. 817 * 818 * Returns: %TRUE if @tree_view is in hover selection mode 819 * 820 * Since: 2.6 821 */ 822 public bool getHoverSelection() 823 { 824 return gtk_tree_view_get_hover_selection(gtkTreeView) != 0; 825 } 826 827 /** 828 * Returns the amount, in pixels, of extra indentation for child levels 829 * in @tree_view. 830 * 831 * Returns: the amount of extra indentation for child levels in 832 * @tree_view. A return value of 0 means that this feature is disabled. 833 * 834 * Since: 2.12 835 */ 836 public int getLevelIndentation() 837 { 838 return gtk_tree_view_get_level_indentation(gtkTreeView); 839 } 840 841 /** 842 * Returns the model the #GtkTreeView is based on. Returns %NULL if the 843 * model is unset. 844 * 845 * Returns: A #GtkTreeModel, or %NULL if 846 * none is currently being used. 847 */ 848 public TreeModelIF getModel() 849 { 850 auto p = gtk_tree_view_get_model(gtkTreeView); 851 852 if(p is null) 853 { 854 return null; 855 } 856 857 return ObjectG.getDObject!(TreeModelIF)(cast(GtkTreeModel*) p); 858 } 859 860 /** 861 * Queries the number of columns in the given @tree_view. 862 * 863 * Returns: The number of columns in the @tree_view 864 * 865 * Since: 3.4 866 */ 867 public uint getNColumns() 868 { 869 return gtk_tree_view_get_n_columns(gtkTreeView); 870 } 871 872 /** 873 * Finds the path at the point (@x, @y), relative to bin_window coordinates 874 * (please see gtk_tree_view_get_bin_window()). 875 * That is, @x and @y are relative to an events coordinates. @x and @y must 876 * come from an event on the @tree_view only where `event->window == 877 * gtk_tree_view_get_bin_window ()`. It is primarily for 878 * things like popup menus. If @path is non-%NULL, then it will be filled 879 * with the #GtkTreePath at that point. This path should be freed with 880 * gtk_tree_path_free(). If @column is non-%NULL, then it will be filled 881 * with the column at that point. @cell_x and @cell_y return the coordinates 882 * relative to the cell background (i.e. the @background_area passed to 883 * gtk_cell_renderer_render()). This function is only meaningful if 884 * @tree_view is realized. Therefore this function will always return %FALSE 885 * if @tree_view is not realized or does not have a model. 886 * 887 * For converting widget coordinates (eg. the ones you get from 888 * GtkWidget::query-tooltip), please see 889 * gtk_tree_view_convert_widget_to_bin_window_coords(). 890 * 891 * Params: 892 * x = The x position to be identified (relative to bin_window). 893 * y = The y position to be identified (relative to bin_window). 894 * path = A pointer to a #GtkTreePath 895 * pointer to be filled in, or %NULL 896 * column = A pointer to 897 * a #GtkTreeViewColumn pointer to be filled in, or %NULL 898 * cellX = A pointer where the X coordinate 899 * relative to the cell can be placed, or %NULL 900 * cellY = A pointer where the Y coordinate 901 * relative to the cell can be placed, or %NULL 902 * 903 * Returns: %TRUE if a row exists at that coordinate. 904 */ 905 public bool getPathAtPos(int x, int y, out TreePath path, out TreeViewColumn column, out int cellX, out int cellY) 906 { 907 GtkTreePath* outpath = null; 908 GtkTreeViewColumn* outcolumn = null; 909 910 auto p = gtk_tree_view_get_path_at_pos(gtkTreeView, x, y, &outpath, &outcolumn, &cellX, &cellY) != 0; 911 912 path = ObjectG.getDObject!(TreePath)(outpath); 913 column = ObjectG.getDObject!(TreeViewColumn)(outcolumn); 914 915 return p; 916 } 917 918 /** 919 * Retrieves whether the user can reorder the tree via drag-and-drop. See 920 * gtk_tree_view_set_reorderable(). 921 * 922 * Returns: %TRUE if the tree can be reordered. 923 */ 924 public bool getReorderable() 925 { 926 return gtk_tree_view_get_reorderable(gtkTreeView) != 0; 927 } 928 929 /** 930 * Returns the current row separator function. 931 * 932 * Returns: the current row separator function. 933 * 934 * Since: 2.6 935 */ 936 public GtkTreeViewRowSeparatorFunc getRowSeparatorFunc() 937 { 938 return gtk_tree_view_get_row_separator_func(gtkTreeView); 939 } 940 941 /** 942 * Returns whether rubber banding is turned on for @tree_view. If the 943 * selection mode is #GTK_SELECTION_MULTIPLE, rubber banding will allow the 944 * user to select multiple rows by dragging the mouse. 945 * 946 * Returns: %TRUE if rubber banding in @tree_view is enabled. 947 * 948 * Since: 2.10 949 */ 950 public bool getRubberBanding() 951 { 952 return gtk_tree_view_get_rubber_banding(gtkTreeView) != 0; 953 } 954 955 /** 956 * Gets the setting set by gtk_tree_view_set_rules_hint(). 957 * 958 * Returns: %TRUE if the hint is set 959 */ 960 public bool getRulesHint() 961 { 962 return gtk_tree_view_get_rules_hint(gtkTreeView) != 0; 963 } 964 965 /** 966 * Gets the column searched on by the interactive search code. 967 * 968 * Returns: the column the interactive search code searches in. 969 */ 970 public int getSearchColumn() 971 { 972 return gtk_tree_view_get_search_column(gtkTreeView); 973 } 974 975 /** 976 * Returns the #GtkEntry which is currently in use as interactive search 977 * entry for @tree_view. In case the built-in entry is being used, %NULL 978 * will be returned. 979 * 980 * Returns: the entry currently in use as search entry. 981 * 982 * Since: 2.10 983 */ 984 public Entry getSearchEntry() 985 { 986 auto p = gtk_tree_view_get_search_entry(gtkTreeView); 987 988 if(p is null) 989 { 990 return null; 991 } 992 993 return ObjectG.getDObject!(Entry)(cast(GtkEntry*) p); 994 } 995 996 /** 997 * Returns the compare function currently in use. 998 * 999 * Returns: the currently used compare function for the search code. 1000 */ 1001 public GtkTreeViewSearchEqualFunc getSearchEqualFunc() 1002 { 1003 return gtk_tree_view_get_search_equal_func(gtkTreeView); 1004 } 1005 1006 /** 1007 * Returns the positioning function currently in use. 1008 * 1009 * Returns: the currently used function for positioning the search dialog. 1010 * 1011 * Since: 2.10 1012 */ 1013 public GtkTreeViewSearchPositionFunc getSearchPositionFunc() 1014 { 1015 return gtk_tree_view_get_search_position_func(gtkTreeView); 1016 } 1017 1018 /** 1019 * Gets the #GtkTreeSelection associated with @tree_view. 1020 * 1021 * Returns: A #GtkTreeSelection object. 1022 */ 1023 public TreeSelection getSelection() 1024 { 1025 auto p = gtk_tree_view_get_selection(gtkTreeView); 1026 1027 if(p is null) 1028 { 1029 return null; 1030 } 1031 1032 return ObjectG.getDObject!(TreeSelection)(cast(GtkTreeSelection*) p); 1033 } 1034 1035 /** 1036 * Returns whether or not expanders are drawn in @tree_view. 1037 * 1038 * Returns: %TRUE if expanders are drawn in @tree_view, %FALSE 1039 * otherwise. 1040 * 1041 * Since: 2.12 1042 */ 1043 public bool getShowExpanders() 1044 { 1045 return gtk_tree_view_get_show_expanders(gtkTreeView) != 0; 1046 } 1047 1048 /** 1049 * Returns the column of @tree_view’s model which is being used for 1050 * displaying tooltips on @tree_view’s rows. 1051 * 1052 * Returns: the index of the tooltip column that is currently being 1053 * used, or -1 if this is disabled. 1054 * 1055 * Since: 2.12 1056 */ 1057 public int getTooltipColumn() 1058 { 1059 return gtk_tree_view_get_tooltip_column(gtkTreeView); 1060 } 1061 1062 /** 1063 * This function is supposed to be used in a #GtkWidget::query-tooltip 1064 * signal handler for #GtkTreeView. The @x, @y and @keyboard_tip values 1065 * which are received in the signal handler, should be passed to this 1066 * function without modification. 1067 * 1068 * The return value indicates whether there is a tree view row at the given 1069 * coordinates (%TRUE) or not (%FALSE) for mouse tooltips. For keyboard 1070 * tooltips the row returned will be the cursor row. When %TRUE, then any of 1071 * @model, @path and @iter which have been provided will be set to point to 1072 * that row and the corresponding model. @x and @y will always be converted 1073 * to be relative to @tree_view’s bin_window if @keyboard_tooltip is %FALSE. 1074 * 1075 * Params: 1076 * x = the x coordinate (relative to widget coordinates) 1077 * y = the y coordinate (relative to widget coordinates) 1078 * keyboardTip = whether this is a keyboard tooltip or not 1079 * model = a pointer to 1080 * receive a #GtkTreeModel or %NULL 1081 * path = a pointer to receive a #GtkTreePath or %NULL 1082 * iter = a pointer to receive a #GtkTreeIter or %NULL 1083 * 1084 * Returns: whether or not the given tooltip context points to a row. 1085 * 1086 * Since: 2.12 1087 */ 1088 public bool getTooltipContext(ref int x, ref int y, bool keyboardTip, out TreeModelIF model, out TreePath path, out TreeIter iter) 1089 { 1090 GtkTreeModel* outmodel = null; 1091 GtkTreePath* outpath = null; 1092 GtkTreeIter* outiter = sliceNew!GtkTreeIter(); 1093 1094 auto p = gtk_tree_view_get_tooltip_context(gtkTreeView, &x, &y, keyboardTip, &outmodel, &outpath, outiter) != 0; 1095 1096 model = ObjectG.getDObject!(TreeModelIF)(outmodel); 1097 path = ObjectG.getDObject!(TreePath)(outpath); 1098 iter = ObjectG.getDObject!(TreeIter)(outiter, true); 1099 1100 return p; 1101 } 1102 1103 /** 1104 * Sets @start_path and @end_path to be the first and last visible path. 1105 * Note that there may be invisible paths in between. 1106 * 1107 * The paths should be freed with gtk_tree_path_free() after use. 1108 * 1109 * Params: 1110 * startPath = Return location for start of region, 1111 * or %NULL. 1112 * endPath = Return location for end of region, or %NULL. 1113 * 1114 * Returns: %TRUE, if valid paths were placed in @start_path and @end_path. 1115 * 1116 * Since: 2.8 1117 */ 1118 public bool getVisibleRange(out TreePath startPath, out TreePath endPath) 1119 { 1120 GtkTreePath* outstartPath = null; 1121 GtkTreePath* outendPath = null; 1122 1123 auto p = gtk_tree_view_get_visible_range(gtkTreeView, &outstartPath, &outendPath) != 0; 1124 1125 startPath = ObjectG.getDObject!(TreePath)(outstartPath); 1126 endPath = ObjectG.getDObject!(TreePath)(outendPath); 1127 1128 return p; 1129 } 1130 1131 /** 1132 * Fills @visible_rect with the currently-visible region of the 1133 * buffer, in tree coordinates. Convert to bin_window coordinates with 1134 * gtk_tree_view_convert_tree_to_bin_window_coords(). 1135 * Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire 1136 * scrollable area of the tree. 1137 * 1138 * Params: 1139 * visibleRect = rectangle to fill 1140 */ 1141 public void getVisibleRect(out GdkRectangle visibleRect) 1142 { 1143 gtk_tree_view_get_visible_rect(gtkTreeView, &visibleRect); 1144 } 1145 1146 /** 1147 * This inserts the @column into the @tree_view at @position. If @position is 1148 * -1, then the column is inserted at the end. If @tree_view has 1149 * “fixed_height” mode enabled, then @column must have its “sizing” property 1150 * set to be GTK_TREE_VIEW_COLUMN_FIXED. 1151 * 1152 * Params: 1153 * column = The #GtkTreeViewColumn to be inserted. 1154 * position = The position to insert @column in. 1155 * 1156 * Returns: The number of columns in @tree_view after insertion. 1157 */ 1158 public int insertColumn(TreeViewColumn column, int position) 1159 { 1160 return gtk_tree_view_insert_column(gtkTreeView, (column is null) ? null : column.getTreeViewColumnStruct(), position); 1161 } 1162 1163 /** 1164 * Convenience function that inserts a new column into the #GtkTreeView 1165 * with the given cell renderer and a #GtkTreeCellDataFunc to set cell renderer 1166 * attributes (normally using data from the model). See also 1167 * gtk_tree_view_column_set_cell_data_func(), gtk_tree_view_column_pack_start(). 1168 * If @tree_view has “fixed_height” mode enabled, then the new column will have its 1169 * “sizing” property set to be GTK_TREE_VIEW_COLUMN_FIXED. 1170 * 1171 * Params: 1172 * position = Position to insert, -1 for append 1173 * title = column title 1174 * cell = cell renderer for column 1175 * func = function to set attributes of cell renderer 1176 * data = data for @func 1177 * dnotify = destroy notifier for @data 1178 * 1179 * Returns: number of columns in the tree view post-insert 1180 */ 1181 public int insertColumnWithDataFunc(int position, string title, CellRenderer cell, GtkTreeCellDataFunc func, void* data, GDestroyNotify dnotify) 1182 { 1183 return gtk_tree_view_insert_column_with_data_func(gtkTreeView, position, Str.toStringz(title), (cell is null) ? null : cell.getCellRendererStruct(), func, data, dnotify); 1184 } 1185 1186 /** 1187 * Determine whether the point (@x, @y) in @tree_view is blank, that is no 1188 * cell content nor an expander arrow is drawn at the location. If so, the 1189 * location can be considered as the background. You might wish to take 1190 * special action on clicks on the background, such as clearing a current 1191 * selection, having a custom context menu or starting rubber banding. 1192 * 1193 * The @x and @y coordinate that are provided must be relative to bin_window 1194 * coordinates. That is, @x and @y must come from an event on @tree_view 1195 * where `event->window == gtk_tree_view_get_bin_window ()`. 1196 * 1197 * For converting widget coordinates (eg. the ones you get from 1198 * GtkWidget::query-tooltip), please see 1199 * gtk_tree_view_convert_widget_to_bin_window_coords(). 1200 * 1201 * The @path, @column, @cell_x and @cell_y arguments will be filled in 1202 * likewise as for gtk_tree_view_get_path_at_pos(). Please see 1203 * gtk_tree_view_get_path_at_pos() for more information. 1204 * 1205 * Params: 1206 * x = The x position to be identified (relative to bin_window) 1207 * y = The y position to be identified (relative to bin_window) 1208 * path = A pointer to a #GtkTreePath pointer to 1209 * be filled in, or %NULL 1210 * column = A pointer to a 1211 * #GtkTreeViewColumn pointer to be filled in, or %NULL 1212 * cellX = A pointer where the X coordinate relative to the 1213 * cell can be placed, or %NULL 1214 * cellY = A pointer where the Y coordinate relative to the 1215 * cell can be placed, or %NULL 1216 * 1217 * Returns: %TRUE if the area at the given coordinates is blank, 1218 * %FALSE otherwise. 1219 * 1220 * Since: 3.0 1221 */ 1222 public bool isBlankAtPos(int x, int y, out TreePath path, out TreeViewColumn column, out int cellX, out int cellY) 1223 { 1224 GtkTreePath* outpath = null; 1225 GtkTreeViewColumn* outcolumn = null; 1226 1227 auto p = gtk_tree_view_is_blank_at_pos(gtkTreeView, x, y, &outpath, &outcolumn, &cellX, &cellY) != 0; 1228 1229 path = ObjectG.getDObject!(TreePath)(outpath); 1230 column = ObjectG.getDObject!(TreeViewColumn)(outcolumn); 1231 1232 return p; 1233 } 1234 1235 /** 1236 * Returns whether a rubber banding operation is currently being done 1237 * in @tree_view. 1238 * 1239 * Returns: %TRUE if a rubber banding operation is currently being 1240 * done in @tree_view. 1241 * 1242 * Since: 2.12 1243 */ 1244 public bool isRubberBandingActive() 1245 { 1246 return gtk_tree_view_is_rubber_banding_active(gtkTreeView) != 0; 1247 } 1248 1249 /** 1250 * Calls @func on all expanded rows. 1251 * 1252 * Params: 1253 * func = A function to be called 1254 * data = User data to be passed to the function. 1255 */ 1256 public void mapExpandedRows(GtkTreeViewMappingFunc func, void* data) 1257 { 1258 gtk_tree_view_map_expanded_rows(gtkTreeView, func, data); 1259 } 1260 1261 /** 1262 * Moves @column to be after to @base_column. If @base_column is %NULL, then 1263 * @column is placed in the first position. 1264 * 1265 * Params: 1266 * column = The #GtkTreeViewColumn to be moved. 1267 * baseColumn = The #GtkTreeViewColumn to be moved relative to, or %NULL. 1268 */ 1269 public void moveColumnAfter(TreeViewColumn column, TreeViewColumn baseColumn) 1270 { 1271 gtk_tree_view_move_column_after(gtkTreeView, (column is null) ? null : column.getTreeViewColumnStruct(), (baseColumn is null) ? null : baseColumn.getTreeViewColumnStruct()); 1272 } 1273 1274 /** 1275 * Removes @column from @tree_view. 1276 * 1277 * Params: 1278 * column = The #GtkTreeViewColumn to remove. 1279 * 1280 * Returns: The number of columns in @tree_view after removing. 1281 */ 1282 public int removeColumn(TreeViewColumn column) 1283 { 1284 return gtk_tree_view_remove_column(gtkTreeView, (column is null) ? null : column.getTreeViewColumnStruct()); 1285 } 1286 1287 /** 1288 * Activates the cell determined by @path and @column. 1289 * 1290 * Params: 1291 * path = The #GtkTreePath to be activated. 1292 * column = The #GtkTreeViewColumn to be activated. 1293 */ 1294 public void rowActivated(TreePath path, TreeViewColumn column) 1295 { 1296 gtk_tree_view_row_activated(gtkTreeView, (path is null) ? null : path.getTreePathStruct(), (column is null) ? null : column.getTreeViewColumnStruct()); 1297 } 1298 1299 /** 1300 * Returns %TRUE if the node pointed to by @path is expanded in @tree_view. 1301 * 1302 * Params: 1303 * path = A #GtkTreePath to test expansion state. 1304 * 1305 * Returns: %TRUE if #path is expanded. 1306 */ 1307 public bool rowExpanded(TreePath path) 1308 { 1309 return gtk_tree_view_row_expanded(gtkTreeView, (path is null) ? null : path.getTreePathStruct()) != 0; 1310 } 1311 1312 /** 1313 * Moves the alignments of @tree_view to the position specified by @column and 1314 * @path. If @column is %NULL, then no horizontal scrolling occurs. Likewise, 1315 * if @path is %NULL no vertical scrolling occurs. At a minimum, one of @column 1316 * or @path need to be non-%NULL. @row_align determines where the row is 1317 * placed, and @col_align determines where @column is placed. Both are expected 1318 * to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means 1319 * right/bottom alignment, 0.5 means center. 1320 * 1321 * If @use_align is %FALSE, then the alignment arguments are ignored, and the 1322 * tree does the minimum amount of work to scroll the cell onto the screen. 1323 * This means that the cell will be scrolled to the edge closest to its current 1324 * position. If the cell is currently visible on the screen, nothing is done. 1325 * 1326 * This function only works if the model is set, and @path is a valid row on the 1327 * model. If the model changes before the @tree_view is realized, the centered 1328 * path will be modified to reflect this change. 1329 * 1330 * Params: 1331 * path = The path of the row to move to, or %NULL. 1332 * column = The #GtkTreeViewColumn to move horizontally to, or %NULL. 1333 * useAlign = whether to use alignment arguments, or %FALSE. 1334 * rowAlign = The vertical alignment of the row specified by @path. 1335 * colAlign = The horizontal alignment of the column specified by @column. 1336 */ 1337 public void scrollToCell(TreePath path, TreeViewColumn column, bool useAlign, float rowAlign, float colAlign) 1338 { 1339 gtk_tree_view_scroll_to_cell(gtkTreeView, (path is null) ? null : path.getTreePathStruct(), (column is null) ? null : column.getTreeViewColumnStruct(), useAlign, rowAlign, colAlign); 1340 } 1341 1342 /** 1343 * Scrolls the tree view such that the top-left corner of the visible 1344 * area is @tree_x, @tree_y, where @tree_x and @tree_y are specified 1345 * in tree coordinates. The @tree_view must be realized before 1346 * this function is called. If it isn't, you probably want to be 1347 * using gtk_tree_view_scroll_to_cell(). 1348 * 1349 * If either @tree_x or @tree_y are -1, then that direction isn’t scrolled. 1350 * 1351 * Params: 1352 * treeX = X coordinate of new top-left pixel of visible area, or -1 1353 * treeY = Y coordinate of new top-left pixel of visible area, or -1 1354 */ 1355 public void scrollToPoint(int treeX, int treeY) 1356 { 1357 gtk_tree_view_scroll_to_point(gtkTreeView, treeX, treeY); 1358 } 1359 1360 /** 1361 * Cause the #GtkTreeView::row-activated signal to be emitted 1362 * on a single click instead of a double click. 1363 * 1364 * Params: 1365 * single = %TRUE to emit row-activated on a single click 1366 * 1367 * Since: 3.8 1368 */ 1369 public void setActivateOnSingleClick(bool single) 1370 { 1371 gtk_tree_view_set_activate_on_single_click(gtkTreeView, single); 1372 } 1373 1374 /** 1375 * Sets a user function for determining where a column may be dropped when 1376 * dragged. This function is called on every column pair in turn at the 1377 * beginning of a column drag to determine where a drop can take place. The 1378 * arguments passed to @func are: the @tree_view, the #GtkTreeViewColumn being 1379 * dragged, the two #GtkTreeViewColumn s determining the drop spot, and 1380 * @user_data. If either of the #GtkTreeViewColumn arguments for the drop spot 1381 * are %NULL, then they indicate an edge. If @func is set to be %NULL, then 1382 * @tree_view reverts to the default behavior of allowing all columns to be 1383 * dropped everywhere. 1384 * 1385 * Params: 1386 * func = A function to determine which columns are reorderable, or %NULL. 1387 * userData = User data to be passed to @func, or %NULL 1388 * destroy = Destroy notifier for @user_data, or %NULL 1389 */ 1390 public void setColumnDragFunction(GtkTreeViewColumnDropFunc func, void* userData, GDestroyNotify destroy) 1391 { 1392 gtk_tree_view_set_column_drag_function(gtkTreeView, func, userData, destroy); 1393 } 1394 1395 /** 1396 * Sets the current keyboard focus to be at @path, and selects it. This is 1397 * useful when you want to focus the user’s attention on a particular row. If 1398 * @focus_column is not %NULL, then focus is given to the column specified by 1399 * it. Additionally, if @focus_column is specified, and @start_editing is 1400 * %TRUE, then editing should be started in the specified cell. 1401 * This function is often followed by @gtk_widget_grab_focus (@tree_view) 1402 * in order to give keyboard focus to the widget. Please note that editing 1403 * can only happen when the widget is realized. 1404 * 1405 * If @path is invalid for @model, the current cursor (if any) will be unset 1406 * and the function will return without failing. 1407 * 1408 * Params: 1409 * path = A #GtkTreePath 1410 * focusColumn = A #GtkTreeViewColumn, or %NULL 1411 * startEditing = %TRUE if the specified cell should start being edited. 1412 */ 1413 public void setCursor(TreePath path, TreeViewColumn focusColumn, bool startEditing) 1414 { 1415 gtk_tree_view_set_cursor(gtkTreeView, (path is null) ? null : path.getTreePathStruct(), (focusColumn is null) ? null : focusColumn.getTreeViewColumnStruct(), startEditing); 1416 } 1417 1418 /** 1419 * Sets the current keyboard focus to be at @path, and selects it. This is 1420 * useful when you want to focus the user’s attention on a particular row. If 1421 * @focus_column is not %NULL, then focus is given to the column specified by 1422 * it. If @focus_column and @focus_cell are not %NULL, and @focus_column 1423 * contains 2 or more editable or activatable cells, then focus is given to 1424 * the cell specified by @focus_cell. Additionally, if @focus_column is 1425 * specified, and @start_editing is %TRUE, then editing should be started in 1426 * the specified cell. This function is often followed by 1427 * @gtk_widget_grab_focus (@tree_view) in order to give keyboard focus to the 1428 * widget. Please note that editing can only happen when the widget is 1429 * realized. 1430 * 1431 * If @path is invalid for @model, the current cursor (if any) will be unset 1432 * and the function will return without failing. 1433 * 1434 * Params: 1435 * path = A #GtkTreePath 1436 * focusColumn = A #GtkTreeViewColumn, or %NULL 1437 * focusCell = A #GtkCellRenderer, or %NULL 1438 * startEditing = %TRUE if the specified cell should start being edited. 1439 * 1440 * Since: 2.2 1441 */ 1442 public void setCursorOnCell(TreePath path, TreeViewColumn focusColumn, CellRenderer focusCell, bool startEditing) 1443 { 1444 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); 1445 } 1446 1447 /** 1448 * This function should almost never be used. It is meant for private use by 1449 * ATK for determining the number of visible children that are removed when the 1450 * user collapses a row, or a row is deleted. 1451 * 1452 * Deprecated: Accessibility does not need the function anymore. 1453 * 1454 * Params: 1455 * func = Function to be called when a view row is destroyed, or %NULL 1456 * data = User data to be passed to @func, or %NULL 1457 * destroy = Destroy notifier for @data, or %NULL 1458 */ 1459 public void setDestroyCountFunc(GtkTreeDestroyCountFunc func, void* data, GDestroyNotify destroy) 1460 { 1461 gtk_tree_view_set_destroy_count_func(gtkTreeView, func, data, destroy); 1462 } 1463 1464 /** 1465 * Sets the row that is highlighted for feedback. 1466 * If @path is %NULL, an existing highlight is removed. 1467 * 1468 * Params: 1469 * path = The path of the row to highlight, or %NULL 1470 * pos = Specifies whether to drop before, after or into the row 1471 */ 1472 public void setDragDestRow(TreePath path, GtkTreeViewDropPosition pos) 1473 { 1474 gtk_tree_view_set_drag_dest_row(gtkTreeView, (path is null) ? null : path.getTreePathStruct(), pos); 1475 } 1476 1477 /** 1478 * If @enable_search is set, then the user can type in text to search through 1479 * the tree interactively (this is sometimes called "typeahead find"). 1480 * 1481 * Note that even if this is %FALSE, the user can still initiate a search 1482 * using the “start-interactive-search” key binding. 1483 * 1484 * Params: 1485 * enableSearch = %TRUE, if the user can search interactively 1486 */ 1487 public void setEnableSearch(bool enableSearch) 1488 { 1489 gtk_tree_view_set_enable_search(gtkTreeView, enableSearch); 1490 } 1491 1492 /** 1493 * Sets whether to draw lines interconnecting the expanders in @tree_view. 1494 * This does not have any visible effects for lists. 1495 * 1496 * Params: 1497 * enabled = %TRUE to enable tree line drawing, %FALSE otherwise. 1498 * 1499 * Since: 2.10 1500 */ 1501 public void setEnableTreeLines(bool enabled) 1502 { 1503 gtk_tree_view_set_enable_tree_lines(gtkTreeView, enabled); 1504 } 1505 1506 /** 1507 * Sets the column to draw the expander arrow at. It must be in @tree_view. 1508 * If @column is %NULL, then the expander arrow is always at the first 1509 * visible column. 1510 * 1511 * If you do not want expander arrow to appear in your tree, set the 1512 * expander column to a hidden column. 1513 * 1514 * Params: 1515 * column = %NULL, or the column to draw the expander arrow at. 1516 */ 1517 public void setExpanderColumn(TreeViewColumn column) 1518 { 1519 gtk_tree_view_set_expander_column(gtkTreeView, (column is null) ? null : column.getTreeViewColumnStruct()); 1520 } 1521 1522 /** 1523 * Enables or disables the fixed height mode of @tree_view. 1524 * Fixed height mode speeds up #GtkTreeView by assuming that all 1525 * rows have the same height. 1526 * Only enable this option if all rows are the same height and all 1527 * columns are of type %GTK_TREE_VIEW_COLUMN_FIXED. 1528 * 1529 * Params: 1530 * enable = %TRUE to enable fixed height mode 1531 * 1532 * Since: 2.6 1533 */ 1534 public void setFixedHeightMode(bool enable) 1535 { 1536 gtk_tree_view_set_fixed_height_mode(gtkTreeView, enable); 1537 } 1538 1539 /** 1540 * Sets which grid lines to draw in @tree_view. 1541 * 1542 * Params: 1543 * gridLines = a #GtkTreeViewGridLines value indicating which grid lines to 1544 * enable. 1545 * 1546 * Since: 2.10 1547 */ 1548 public void setGridLines(GtkTreeViewGridLines gridLines) 1549 { 1550 gtk_tree_view_set_grid_lines(gtkTreeView, gridLines); 1551 } 1552 1553 /** 1554 * Allow the column title buttons to be clicked. 1555 * 1556 * Params: 1557 * setting = %TRUE if the columns are clickable. 1558 */ 1559 public void setHeadersClickable(bool setting) 1560 { 1561 gtk_tree_view_set_headers_clickable(gtkTreeView, setting); 1562 } 1563 1564 /** 1565 * Sets the visibility state of the headers. 1566 * 1567 * Params: 1568 * headersVisible = %TRUE if the headers are visible 1569 */ 1570 public void setHeadersVisible(bool headersVisible) 1571 { 1572 gtk_tree_view_set_headers_visible(gtkTreeView, headersVisible); 1573 } 1574 1575 /** 1576 * Enables or disables the hover expansion mode of @tree_view. 1577 * Hover expansion makes rows expand or collapse if the pointer 1578 * moves over them. 1579 * 1580 * Params: 1581 * expand = %TRUE to enable hover selection mode 1582 * 1583 * Since: 2.6 1584 */ 1585 public void setHoverExpand(bool expand) 1586 { 1587 gtk_tree_view_set_hover_expand(gtkTreeView, expand); 1588 } 1589 1590 /** 1591 * Enables or disables the hover selection mode of @tree_view. 1592 * Hover selection makes the selected row follow the pointer. 1593 * Currently, this works only for the selection modes 1594 * %GTK_SELECTION_SINGLE and %GTK_SELECTION_BROWSE. 1595 * 1596 * Params: 1597 * hover = %TRUE to enable hover selection mode 1598 * 1599 * Since: 2.6 1600 */ 1601 public void setHoverSelection(bool hover) 1602 { 1603 gtk_tree_view_set_hover_selection(gtkTreeView, hover); 1604 } 1605 1606 /** 1607 * Sets the amount of extra indentation for child levels to use in @tree_view 1608 * in addition to the default indentation. The value should be specified in 1609 * pixels, a value of 0 disables this feature and in this case only the default 1610 * indentation will be used. 1611 * This does not have any visible effects for lists. 1612 * 1613 * Params: 1614 * indentation = the amount, in pixels, of extra indentation in @tree_view. 1615 * 1616 * Since: 2.12 1617 */ 1618 public void setLevelIndentation(int indentation) 1619 { 1620 gtk_tree_view_set_level_indentation(gtkTreeView, indentation); 1621 } 1622 1623 /** 1624 * Sets the model for a #GtkTreeView. If the @tree_view already has a model 1625 * set, it will remove it before setting the new model. If @model is %NULL, 1626 * then it will unset the old model. 1627 * 1628 * Params: 1629 * model = The model. 1630 */ 1631 public void setModel(TreeModelIF model) 1632 { 1633 gtk_tree_view_set_model(gtkTreeView, (model is null) ? null : model.getTreeModelStruct()); 1634 } 1635 1636 /** 1637 * This function is a convenience function to allow you to reorder 1638 * models that support the #GtkTreeDragSourceIface and the 1639 * #GtkTreeDragDestIface. Both #GtkTreeStore and #GtkListStore support 1640 * these. If @reorderable is %TRUE, then the user can reorder the 1641 * model by dragging and dropping rows. The developer can listen to 1642 * these changes by connecting to the model’s #GtkTreeModel::row-inserted 1643 * and #GtkTreeModel::row-deleted signals. The reordering is implemented 1644 * by setting up the tree view as a drag source and destination. 1645 * Therefore, drag and drop can not be used in a reorderable view for any 1646 * other purpose. 1647 * 1648 * This function does not give you any degree of control over the order -- any 1649 * reordering is allowed. If more control is needed, you should probably 1650 * handle drag and drop manually. 1651 * 1652 * Params: 1653 * reorderable = %TRUE, if the tree can be reordered. 1654 */ 1655 public void setReorderable(bool reorderable) 1656 { 1657 gtk_tree_view_set_reorderable(gtkTreeView, reorderable); 1658 } 1659 1660 /** 1661 * Sets the row separator function, which is used to determine 1662 * whether a row should be drawn as a separator. If the row separator 1663 * function is %NULL, no separators are drawn. This is the default value. 1664 * 1665 * Params: 1666 * func = a #GtkTreeViewRowSeparatorFunc 1667 * data = user data to pass to @func, or %NULL 1668 * destroy = destroy notifier for @data, or %NULL 1669 * 1670 * Since: 2.6 1671 */ 1672 public void setRowSeparatorFunc(GtkTreeViewRowSeparatorFunc func, void* data, GDestroyNotify destroy) 1673 { 1674 gtk_tree_view_set_row_separator_func(gtkTreeView, func, data, destroy); 1675 } 1676 1677 /** 1678 * Enables or disables rubber banding in @tree_view. If the selection mode 1679 * is #GTK_SELECTION_MULTIPLE, rubber banding will allow the user to select 1680 * multiple rows by dragging the mouse. 1681 * 1682 * Params: 1683 * enable = %TRUE to enable rubber banding 1684 * 1685 * Since: 2.10 1686 */ 1687 public void setRubberBanding(bool enable) 1688 { 1689 gtk_tree_view_set_rubber_banding(gtkTreeView, enable); 1690 } 1691 1692 /** 1693 * Sets a hint for the theme to draw even/odd rows in the @tree_view 1694 * with different colors, also known as "zebra striping". 1695 * 1696 * This function tells the GTK+ theme that the user interface for your 1697 * application requires users to read across tree rows and associate 1698 * cells with one another. 1699 * 1700 * Do not use it just because you prefer the appearance of the ruled 1701 * tree; that’s a question for the theme. Some themes will draw tree 1702 * rows in alternating colors even when rules are turned off, and 1703 * users who prefer that appearance all the time can choose those 1704 * themes. You should call this function only as a semantic hint to 1705 * the theme engine that your tree makes alternating colors useful 1706 * from a functional standpoint (since it has lots of columns, 1707 * generally). 1708 * 1709 * Params: 1710 * setting = %TRUE if the tree requires reading across rows 1711 */ 1712 public void setRulesHint(bool setting) 1713 { 1714 gtk_tree_view_set_rules_hint(gtkTreeView, setting); 1715 } 1716 1717 /** 1718 * Sets @column as the column where the interactive search code should 1719 * search in for the current model. 1720 * 1721 * If the search column is set, users can use the “start-interactive-search” 1722 * key binding to bring up search popup. The enable-search property controls 1723 * whether simply typing text will also start an interactive search. 1724 * 1725 * Note that @column refers to a column of the current model. The search 1726 * column is reset to -1 when the model is changed. 1727 * 1728 * Params: 1729 * column = the column of the model to search in, or -1 to disable searching 1730 */ 1731 public void setSearchColumn(int column) 1732 { 1733 gtk_tree_view_set_search_column(gtkTreeView, column); 1734 } 1735 1736 /** 1737 * Sets the entry which the interactive search code will use for this 1738 * @tree_view. This is useful when you want to provide a search entry 1739 * in our interface at all time at a fixed position. Passing %NULL for 1740 * @entry will make the interactive search code use the built-in popup 1741 * entry again. 1742 * 1743 * Params: 1744 * entry = the entry the interactive search code of @tree_view should use or %NULL 1745 * 1746 * Since: 2.10 1747 */ 1748 public void setSearchEntry(Entry entry) 1749 { 1750 gtk_tree_view_set_search_entry(gtkTreeView, (entry is null) ? null : entry.getEntryStruct()); 1751 } 1752 1753 /** 1754 * Sets the compare function for the interactive search capabilities; note 1755 * that somewhat like strcmp() returning 0 for equality 1756 * #GtkTreeViewSearchEqualFunc returns %FALSE on matches. 1757 * 1758 * Params: 1759 * searchEqualFunc = the compare function to use during the search 1760 * searchUserData = user data to pass to @search_equal_func, or %NULL 1761 * searchDestroy = Destroy notifier for @search_user_data, or %NULL 1762 */ 1763 public void setSearchEqualFunc(GtkTreeViewSearchEqualFunc searchEqualFunc, void* searchUserData, GDestroyNotify searchDestroy) 1764 { 1765 gtk_tree_view_set_search_equal_func(gtkTreeView, searchEqualFunc, searchUserData, searchDestroy); 1766 } 1767 1768 /** 1769 * Sets the function to use when positioning the search dialog. 1770 * 1771 * Params: 1772 * func = the function to use to position the search dialog, or %NULL 1773 * to use the default search position function 1774 * data = user data to pass to @func, or %NULL 1775 * destroy = Destroy notifier for @data, or %NULL 1776 * 1777 * Since: 2.10 1778 */ 1779 public void setSearchPositionFunc(GtkTreeViewSearchPositionFunc func, void* data, GDestroyNotify destroy) 1780 { 1781 gtk_tree_view_set_search_position_func(gtkTreeView, func, data, destroy); 1782 } 1783 1784 /** 1785 * Sets whether to draw and enable expanders and indent child rows in 1786 * @tree_view. When disabled there will be no expanders visible in trees 1787 * and there will be no way to expand and collapse rows by default. Also 1788 * note that hiding the expanders will disable the default indentation. You 1789 * can set a custom indentation in this case using 1790 * gtk_tree_view_set_level_indentation(). 1791 * This does not have any visible effects for lists. 1792 * 1793 * Params: 1794 * enabled = %TRUE to enable expander drawing, %FALSE otherwise. 1795 * 1796 * Since: 2.12 1797 */ 1798 public void setShowExpanders(bool enabled) 1799 { 1800 gtk_tree_view_set_show_expanders(gtkTreeView, enabled); 1801 } 1802 1803 /** 1804 * Sets the tip area of @tooltip to the area @path, @column and @cell have 1805 * in common. For example if @path is %NULL and @column is set, the tip 1806 * area will be set to the full area covered by @column. See also 1807 * gtk_tooltip_set_tip_area(). 1808 * 1809 * Note that if @path is not specified and @cell is set and part of a column 1810 * containing the expander, the tooltip might not show and hide at the correct 1811 * position. In such cases @path must be set to the current node under the 1812 * mouse cursor for this function to operate correctly. 1813 * 1814 * See also gtk_tree_view_set_tooltip_column() for a simpler alternative. 1815 * 1816 * Params: 1817 * tooltip = a #GtkTooltip 1818 * path = a #GtkTreePath or %NULL 1819 * column = a #GtkTreeViewColumn or %NULL 1820 * cell = a #GtkCellRenderer or %NULL 1821 * 1822 * Since: 2.12 1823 */ 1824 public void setTooltipCell(Tooltip tooltip, TreePath path, TreeViewColumn column, CellRenderer cell) 1825 { 1826 gtk_tree_view_set_tooltip_cell(gtkTreeView, (tooltip is null) ? null : tooltip.getTooltipStruct(), (path is null) ? null : path.getTreePathStruct(), (column is null) ? null : column.getTreeViewColumnStruct(), (cell is null) ? null : cell.getCellRendererStruct()); 1827 } 1828 1829 /** 1830 * If you only plan to have simple (text-only) tooltips on full rows, you 1831 * can use this function to have #GtkTreeView handle these automatically 1832 * for you. @column should be set to the column in @tree_view’s model 1833 * containing the tooltip texts, or -1 to disable this feature. 1834 * 1835 * When enabled, #GtkWidget:has-tooltip will be set to %TRUE and 1836 * @tree_view will connect a #GtkWidget::query-tooltip signal handler. 1837 * 1838 * Note that the signal handler sets the text with gtk_tooltip_set_markup(), 1839 * so &, <, etc have to be escaped in the text. 1840 * 1841 * Params: 1842 * column = an integer, which is a valid column number for @tree_view’s model 1843 * 1844 * Since: 2.12 1845 */ 1846 public void setTooltipColumn(int column) 1847 { 1848 gtk_tree_view_set_tooltip_column(gtkTreeView, column); 1849 } 1850 1851 /** 1852 * Sets the tip area of @tooltip to be the area covered by the row at @path. 1853 * See also gtk_tree_view_set_tooltip_column() for a simpler alternative. 1854 * See also gtk_tooltip_set_tip_area(). 1855 * 1856 * Params: 1857 * tooltip = a #GtkTooltip 1858 * path = a #GtkTreePath 1859 * 1860 * Since: 2.12 1861 */ 1862 public void setTooltipRow(Tooltip tooltip, TreePath path) 1863 { 1864 gtk_tree_view_set_tooltip_row(gtkTreeView, (tooltip is null) ? null : tooltip.getTooltipStruct(), (path is null) ? null : path.getTreePathStruct()); 1865 } 1866 1867 /** 1868 * Undoes the effect of 1869 * gtk_tree_view_enable_model_drag_dest(). Calling this method sets 1870 * #GtkTreeView:reorderable to %FALSE. 1871 */ 1872 public void unsetRowsDragDest() 1873 { 1874 gtk_tree_view_unset_rows_drag_dest(gtkTreeView); 1875 } 1876 1877 /** 1878 * Undoes the effect of 1879 * gtk_tree_view_enable_model_drag_source(). Calling this method sets 1880 * #GtkTreeView:reorderable to %FALSE. 1881 */ 1882 public void unsetRowsDragSource() 1883 { 1884 gtk_tree_view_unset_rows_drag_source(gtkTreeView); 1885 } 1886 1887 /** 1888 * The number of columns of the treeview has changed. 1889 */ 1890 gulong addOnColumnsChanged(void delegate(TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1891 { 1892 return Signals.connect(this, "columns-changed", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1893 } 1894 1895 /** 1896 * The position of the cursor (focused cell) has changed. 1897 */ 1898 gulong addOnCursorChanged(void delegate(TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1899 { 1900 return Signals.connect(this, "cursor-changed", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1901 } 1902 1903 /** */ 1904 gulong addOnExpandCollapseCursorRow(bool delegate(bool, bool, bool, TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1905 { 1906 return Signals.connect(this, "expand-collapse-cursor-row", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1907 } 1908 1909 /** 1910 * The #GtkTreeView::move-cursor signal is a [keybinding 1911 * signal][GtkBindingSignal] which gets emitted when the user 1912 * presses one of the cursor keys. 1913 * 1914 * Applications should not connect to it, but may emit it with 1915 * g_signal_emit_by_name() if they need to control the cursor 1916 * programmatically. In contrast to gtk_tree_view_set_cursor() and 1917 * gtk_tree_view_set_cursor_on_cell() when moving horizontally 1918 * #GtkTreeView::move-cursor does not reset the current selection. 1919 * 1920 * Params: 1921 * step = the granularity of the move, as a 1922 * #GtkMovementStep. %GTK_MOVEMENT_LOGICAL_POSITIONS, 1923 * %GTK_MOVEMENT_VISUAL_POSITIONS, %GTK_MOVEMENT_DISPLAY_LINES, 1924 * %GTK_MOVEMENT_PAGES and %GTK_MOVEMENT_BUFFER_ENDS are 1925 * supported. %GTK_MOVEMENT_LOGICAL_POSITIONS and 1926 * %GTK_MOVEMENT_VISUAL_POSITIONS are treated identically. 1927 * direction = the direction to move: +1 to move forwards; 1928 * -1 to move backwards. The resulting movement is 1929 * undefined for all other values. 1930 * 1931 * Returns: %TRUE if @step is supported, %FALSE otherwise. 1932 */ 1933 gulong addOnMoveCursor(bool delegate(GtkMovementStep, int, TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1934 { 1935 return Signals.connect(this, "move-cursor", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1936 } 1937 1938 /** 1939 * The "row-activated" signal is emitted when the method 1940 * gtk_tree_view_row_activated() is called, when the user double 1941 * clicks a treeview row with the "activate-on-single-click" 1942 * property set to %FALSE, or when the user single clicks a row when 1943 * the "activate-on-single-click" property set to %TRUE. It is also 1944 * emitted when a non-editable row is selected and one of the keys: 1945 * Space, Shift+Space, Return or Enter is pressed. 1946 * 1947 * For selection handling refer to the 1948 * [tree widget conceptual overview][TreeWidget] 1949 * as well as #GtkTreeSelection. 1950 * 1951 * Params: 1952 * path = the #GtkTreePath for the activated row 1953 * column = the #GtkTreeViewColumn in which the activation occurred 1954 */ 1955 gulong addOnRowActivated(void delegate(TreePath, TreeViewColumn, TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1956 { 1957 return Signals.connect(this, "row-activated", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1958 } 1959 1960 /** 1961 * The given row has been collapsed (child nodes are hidden). 1962 * 1963 * Params: 1964 * iter = the tree iter of the collapsed row 1965 * path = a tree path that points to the row 1966 */ 1967 gulong addOnRowCollapsed(void delegate(TreeIter, TreePath, TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1968 { 1969 return Signals.connect(this, "row-collapsed", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1970 } 1971 1972 /** 1973 * The given row has been expanded (child nodes are shown). 1974 * 1975 * Params: 1976 * iter = the tree iter of the expanded row 1977 * path = a tree path that points to the row 1978 */ 1979 gulong addOnRowExpanded(void delegate(TreeIter, TreePath, TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1980 { 1981 return Signals.connect(this, "row-expanded", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1982 } 1983 1984 /** */ 1985 gulong addOnSelectAll(bool delegate(TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1986 { 1987 return Signals.connect(this, "select-all", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1988 } 1989 1990 /** */ 1991 gulong addOnSelectCursorParent(bool delegate(TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1992 { 1993 return Signals.connect(this, "select-cursor-parent", dlg, connectFlags ^ ConnectFlags.SWAPPED); 1994 } 1995 1996 /** */ 1997 gulong addOnSelectCursorRow(bool delegate(bool, TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 1998 { 1999 return Signals.connect(this, "select-cursor-row", dlg, connectFlags ^ ConnectFlags.SWAPPED); 2000 } 2001 2002 /** */ 2003 gulong addOnStartInteractiveSearch(bool delegate(TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 2004 { 2005 return Signals.connect(this, "start-interactive-search", dlg, connectFlags ^ ConnectFlags.SWAPPED); 2006 } 2007 2008 /** 2009 * The given row is about to be collapsed (hide its children nodes). Use this 2010 * signal if you need to control the collapsibility of individual rows. 2011 * 2012 * Params: 2013 * iter = the tree iter of the row to collapse 2014 * path = a tree path that points to the row 2015 * 2016 * Returns: %FALSE to allow collapsing, %TRUE to reject 2017 */ 2018 gulong addOnTestCollapseRow(bool delegate(TreeIter, TreePath, TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 2019 { 2020 return Signals.connect(this, "test-collapse-row", dlg, connectFlags ^ ConnectFlags.SWAPPED); 2021 } 2022 2023 /** 2024 * The given row is about to be expanded (show its children nodes). Use this 2025 * signal if you need to control the expandability of individual rows. 2026 * 2027 * Params: 2028 * iter = the tree iter of the row to expand 2029 * path = a tree path that points to the row 2030 * 2031 * Returns: %FALSE to allow expansion, %TRUE to reject 2032 */ 2033 gulong addOnTestExpandRow(bool delegate(TreeIter, TreePath, TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 2034 { 2035 return Signals.connect(this, "test-expand-row", dlg, connectFlags ^ ConnectFlags.SWAPPED); 2036 } 2037 2038 /** */ 2039 gulong addOnToggleCursorRow(bool delegate(TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 2040 { 2041 return Signals.connect(this, "toggle-cursor-row", dlg, connectFlags ^ ConnectFlags.SWAPPED); 2042 } 2043 2044 /** */ 2045 gulong addOnUnselectAll(bool delegate(TreeView) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 2046 { 2047 return Signals.connect(this, "unselect-all", dlg, connectFlags ^ ConnectFlags.SWAPPED); 2048 } 2049 }