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 * Conversion parameters: 26 * inFile = GtkTreeViewColumn.html 27 * outPack = gtk 28 * outFile = TreeViewColumn 29 * strct = GtkTreeViewColumn 30 * realStrct= 31 * ctorStrct= 32 * clss = TreeViewColumn 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - CellLayoutIF 40 * prefixes: 41 * - gtk_tree_view_column_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * - gtk_tree_view_column_pack_start 46 * - gtk_tree_view_column_pack_end 47 * - gtk_tree_view_column_clear 48 * - gtk_tree_view_column_add_attribute 49 * - gtk_tree_view_column_clear_attributes 50 * - gtk_tree_view_column_get_button 51 * - gtk_tree_view_column_get_tree_view 52 * - gtk_tree_view_column_new_with_attributes 53 * omit signals: 54 * imports: 55 * - glib.Str 56 * - gtk.Button 57 * - gtk.CellArea 58 * - gtk.CellRenderer 59 * - gtk.TreeIter 60 * - gtk.TreeModelIF 61 * - gtk.TreeView 62 * - gtk.Widget 63 * - gtk.CellLayoutIF 64 * - gtk.CellLayoutT 65 * structWrap: 66 * - GtkCellArea* -> CellArea 67 * - GtkCellRenderer* -> CellRenderer 68 * - GtkTreeIter* -> TreeIter 69 * - GtkTreeModel* -> TreeModelIF 70 * - GtkWidget* -> Widget 71 * module aliases: 72 * local aliases: 73 * overrides: 74 */ 75 76 module gtk.TreeViewColumn; 77 78 public import gtkc.gtktypes; 79 80 private import gtkc.gtk; 81 private import glib.ConstructionException; 82 private import gobject.ObjectG; 83 84 private import gobject.Signals; 85 public import gtkc.gdktypes; 86 private import glib.Str; 87 private import gtk.Button; 88 private import gtk.CellArea; 89 private import gtk.CellRenderer; 90 private import gtk.TreeIter; 91 private import gtk.TreeModelIF; 92 private import gtk.TreeView; 93 private import gtk.Widget; 94 private import gtk.CellLayoutIF; 95 private import gtk.CellLayoutT; 96 97 98 private import gobject.ObjectG; 99 100 /** 101 * The GtkTreeViewColumn object represents a visible column in a GtkTreeView widget. 102 * It allows to set properties of the column header, and functions as a holding pen for 103 * the cell renderers which determine how the data in the column is displayed. 104 * 105 * Please refer to the tree widget conceptual overview 106 * for an overview of all the objects and data types related to the tree widget and how 107 * they work together. 108 */ 109 public class TreeViewColumn : ObjectG, CellLayoutIF 110 { 111 112 /** the main Gtk struct */ 113 protected GtkTreeViewColumn* gtkTreeViewColumn; 114 115 116 /** Get the main Gtk struct */ 117 public GtkTreeViewColumn* getTreeViewColumnStruct() 118 { 119 return gtkTreeViewColumn; 120 } 121 122 123 /** the main Gtk struct as a void* */ 124 protected override void* getStruct() 125 { 126 return cast(void*)gtkTreeViewColumn; 127 } 128 129 /** 130 * Sets our main struct and passes it to the parent class 131 */ 132 public this (GtkTreeViewColumn* gtkTreeViewColumn) 133 { 134 super(cast(GObject*)gtkTreeViewColumn); 135 this.gtkTreeViewColumn = gtkTreeViewColumn; 136 } 137 138 protected override void setStruct(GObject* obj) 139 { 140 super.setStruct(obj); 141 gtkTreeViewColumn = cast(GtkTreeViewColumn*)obj; 142 } 143 144 // add the CellLayout capabilities 145 mixin CellLayoutT!(GtkTreeViewColumn); 146 147 /** 148 * Creates a new Tree view column 149 * Params: 150 * header = th column header text 151 * renderer = the rederer for the column cells 152 * type = the type of data to be displayed (shouldn't this be on the renderer?) 153 * column = the column number 154 * Throws: ConstructionException GTK+ fails to create the object. 155 */ 156 this(string header, CellRenderer renderer, string type, int column) 157 { 158 auto p = gtk_tree_view_column_new_with_attributes( 159 Str.toStringz(header), 160 renderer.getCellRendererStruct(), 161 Str.toStringz(type), 162 column, 163 null); 164 165 if(p is null) 166 { 167 throw new ConstructionException("null returned by gtk_tree_view_column_new_with_attributes"); 168 } 169 170 this(p); 171 } 172 173 /** 174 * Returns the button used in the treeview column header 175 * Returns: The button for the column header. [transfer none] Since 3.0 176 */ 177 public Button getButton() 178 { 179 // GtkWidget * gtk_tree_view_column_get_button (GtkTreeViewColumn *tree_column); 180 auto p = gtk_tree_view_column_get_button(gtkTreeViewColumn); 181 if(p is null) 182 { 183 return null; 184 } 185 return new Button(cast(GtkButton*) p); 186 } 187 188 /** 189 * Returns the GtkTreeView wherein tree_column has been inserted. 190 * If column is currently not inserted in any tree view, NULL is 191 * returned. 192 * Since 2.12 193 * Returns: The tree view wherein column has been inserted if any, NULL otherwise. [transfer none] 194 */ 195 public TreeView getTreeView() 196 { 197 // GtkWidget * gtk_tree_view_column_get_tree_view (GtkTreeViewColumn *tree_column); 198 auto p = gtk_tree_view_column_get_tree_view(gtkTreeViewColumn); 199 if(p is null) 200 { 201 return null; 202 } 203 return new TreeView(cast(GtkTreeView*) p); 204 } 205 206 /** 207 */ 208 int[string] connectedSignals; 209 210 void delegate(TreeViewColumn)[] onClickedListeners; 211 /** 212 * See Also 213 * GtkTreeView, GtkTreeSelection, GtkTreeDnd, GtkTreeMode, GtkTreeSortable, 214 * GtkTreeModelSort, GtkListStore, GtkTreeStore, GtkCellRenderer, GtkCellEditable, 215 * GtkCellRendererPixbuf, GtkCellRendererText, GtkCellRendererToggle 216 */ 217 void addOnClicked(void delegate(TreeViewColumn) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 218 { 219 if ( !("clicked" in connectedSignals) ) 220 { 221 Signals.connectData( 222 getStruct(), 223 "clicked", 224 cast(GCallback)&callBackClicked, 225 cast(void*)this, 226 null, 227 connectFlags); 228 connectedSignals["clicked"] = 1; 229 } 230 onClickedListeners ~= dlg; 231 } 232 extern(C) static void callBackClicked(GtkTreeViewColumn* treeviewcolumnStruct, TreeViewColumn _treeViewColumn) 233 { 234 foreach ( void delegate(TreeViewColumn) dlg ; _treeViewColumn.onClickedListeners ) 235 { 236 dlg(_treeViewColumn); 237 } 238 } 239 240 241 /** 242 * Creates a new GtkTreeViewColumn. 243 * Throws: ConstructionException GTK+ fails to create the object. 244 */ 245 public this () 246 { 247 // GtkTreeViewColumn * gtk_tree_view_column_new (void); 248 auto p = gtk_tree_view_column_new(); 249 if(p is null) 250 { 251 throw new ConstructionException("null returned by gtk_tree_view_column_new()"); 252 } 253 this(cast(GtkTreeViewColumn*) p); 254 } 255 256 /** 257 * Creates a new GtkTreeViewColumn using area to render its cells. 258 * Params: 259 * area = the GtkCellArea that the newly created column should use to layout cells. 260 * Throws: ConstructionException GTK+ fails to create the object. 261 */ 262 public this (CellArea area) 263 { 264 // GtkTreeViewColumn * gtk_tree_view_column_new_with_area (GtkCellArea *area); 265 auto p = gtk_tree_view_column_new_with_area((area is null) ? null : area.getCellAreaStruct()); 266 if(p is null) 267 { 268 throw new ConstructionException("null returned by gtk_tree_view_column_new_with_area((area is null) ? null : area.getCellAreaStruct())"); 269 } 270 this(cast(GtkTreeViewColumn*) p); 271 } 272 273 /** 274 * Sets the GtkTreeCellDataFunc to use for the column. This 275 * function is used instead of the standard attributes mapping for 276 * setting the column value, and should set the value of tree_column's 277 * cell renderer as appropriate. func may be NULL to remove an 278 * older one. 279 * Params: 280 * cellRenderer = A GtkCellRenderer 281 * func = The GtkTreeCellDataFunc to use. [allow-none] 282 * funcData = The user data for func. 283 * destroy = The destroy notification for func_data 284 */ 285 public void setCellDataFunc(CellRenderer cellRenderer, GtkTreeCellDataFunc func, void* funcData, GDestroyNotify destroy) 286 { 287 // void gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell_renderer, GtkTreeCellDataFunc func, gpointer func_data, GDestroyNotify destroy); 288 gtk_tree_view_column_set_cell_data_func(gtkTreeViewColumn, (cellRenderer is null) ? null : cellRenderer.getCellRendererStruct(), func, funcData, destroy); 289 } 290 291 /** 292 * Sets the spacing field of tree_column, which is the number of pixels to 293 * place between cell renderers packed into it. 294 * Params: 295 * spacing = distance between cell renderers in pixels. 296 */ 297 public void setSpacing(int spacing) 298 { 299 // void gtk_tree_view_column_set_spacing (GtkTreeViewColumn *tree_column, gint spacing); 300 gtk_tree_view_column_set_spacing(gtkTreeViewColumn, spacing); 301 } 302 303 /** 304 * Returns the spacing of tree_column. 305 * Returns: the spacing of tree_column. 306 */ 307 public int getSpacing() 308 { 309 // gint gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column); 310 return gtk_tree_view_column_get_spacing(gtkTreeViewColumn); 311 } 312 313 /** 314 * Sets the visibility of tree_column. 315 * Params: 316 * visible = TRUE if the tree_column is visible. 317 */ 318 public void setVisible(int visible) 319 { 320 // void gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column, gboolean visible); 321 gtk_tree_view_column_set_visible(gtkTreeViewColumn, visible); 322 } 323 324 /** 325 * Returns TRUE if tree_column is visible. 326 * Returns: whether the column is visible or not. If it is visible, then the tree will show the column. 327 */ 328 public int getVisible() 329 { 330 // gboolean gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column); 331 return gtk_tree_view_column_get_visible(gtkTreeViewColumn); 332 } 333 334 /** 335 * If resizable is TRUE, then the user can explicitly resize the column by 336 * grabbing the outer edge of the column button. If resizable is TRUE and 337 * sizing mode of the column is GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing 338 * mode is changed to GTK_TREE_VIEW_COLUMN_GROW_ONLY. 339 * Params: 340 * resizable = TRUE, if the column can be resized 341 */ 342 public void setResizable(int resizable) 343 { 344 // void gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column, gboolean resizable); 345 gtk_tree_view_column_set_resizable(gtkTreeViewColumn, resizable); 346 } 347 348 /** 349 * Returns TRUE if the tree_column can be resized by the end user. 350 * Returns: TRUE, if the tree_column can be resized. 351 */ 352 public int getResizable() 353 { 354 // gboolean gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column); 355 return gtk_tree_view_column_get_resizable(gtkTreeViewColumn); 356 } 357 358 /** 359 * Sets the growth behavior of tree_column to type. 360 * Params: 361 * type = The GtkTreeViewColumnSizing. 362 */ 363 public void setSizing(GtkTreeViewColumnSizing type) 364 { 365 // void gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column, GtkTreeViewColumnSizing type); 366 gtk_tree_view_column_set_sizing(gtkTreeViewColumn, type); 367 } 368 369 /** 370 * Returns the current type of tree_column. 371 * Returns: The type of tree_column. 372 */ 373 public GtkTreeViewColumnSizing getSizing() 374 { 375 // GtkTreeViewColumnSizing gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column); 376 return gtk_tree_view_column_get_sizing(gtkTreeViewColumn); 377 } 378 379 /** 380 * Returns the current size of tree_column in pixels. 381 * Returns: The current width of tree_column. 382 */ 383 public int getWidth() 384 { 385 // gint gtk_tree_view_column_get_width (GtkTreeViewColumn *tree_column); 386 return gtk_tree_view_column_get_width(gtkTreeViewColumn); 387 } 388 389 /** 390 * Gets the fixed width of the column. This may not be the actual displayed 391 * width of the column; for that, use gtk_tree_view_column_get_width(). 392 * Returns: The fixed width of the column. 393 */ 394 public int getFixedWidth() 395 { 396 // gint gtk_tree_view_column_get_fixed_width (GtkTreeViewColumn *tree_column); 397 return gtk_tree_view_column_get_fixed_width(gtkTreeViewColumn); 398 } 399 400 /** 401 * If fixed_width is not -1, sets the fixed width of tree_column; otherwise 402 * unsets it. The effective value of fixed_width is clamped between the 403 * minumum and maximum width of the column; however, the value stored in the 404 * "fixed-width" property is not clamped. If the column sizing is 405 * GTK_TREE_VIEW_COLUMN_GROW_ONLY or GTK_TREE_VIEW_COLUMN_AUTOSIZE, setting a 406 * fixed width overrides the automatically calculated width. Note that 407 * fixed_width is only a hint to GTK+; the width actually allocated to the 408 * column may be greater or less than requested. 409 * Along with "expand", the "fixed-width" property changes when the column is 410 * resized by the user. 411 * Params: 412 * fixedWidth = The new fixed width, in pixels, or -1. 413 */ 414 public void setFixedWidth(int fixedWidth) 415 { 416 // void gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *tree_column, gint fixed_width); 417 gtk_tree_view_column_set_fixed_width(gtkTreeViewColumn, fixedWidth); 418 } 419 420 /** 421 * Sets the minimum width of the tree_column. If min_width is -1, then the 422 * minimum width is unset. 423 * Params: 424 * minWidth = The minimum width of the column in pixels, or -1. 425 */ 426 public void setMinWidth(int minWidth) 427 { 428 // void gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column, gint min_width); 429 gtk_tree_view_column_set_min_width(gtkTreeViewColumn, minWidth); 430 } 431 432 /** 433 * Returns the minimum width in pixels of the tree_column, or -1 if no minimum 434 * width is set. 435 * Returns: The minimum width of the tree_column. 436 */ 437 public int getMinWidth() 438 { 439 // gint gtk_tree_view_column_get_min_width (GtkTreeViewColumn *tree_column); 440 return gtk_tree_view_column_get_min_width(gtkTreeViewColumn); 441 } 442 443 /** 444 * Sets the maximum width of the tree_column. If max_width is -1, then the 445 * maximum width is unset. Note, the column can actually be wider than max 446 * width if it's the last column in a view. In this case, the column expands to 447 * fill any extra space. 448 * Params: 449 * maxWidth = The maximum width of the column in pixels, or -1. 450 */ 451 public void setMaxWidth(int maxWidth) 452 { 453 // void gtk_tree_view_column_set_max_width (GtkTreeViewColumn *tree_column, gint max_width); 454 gtk_tree_view_column_set_max_width(gtkTreeViewColumn, maxWidth); 455 } 456 457 /** 458 * Returns the maximum width in pixels of the tree_column, or -1 if no maximum 459 * width is set. 460 * Returns: The maximum width of the tree_column. 461 */ 462 public int getMaxWidth() 463 { 464 // gint gtk_tree_view_column_get_max_width (GtkTreeViewColumn *tree_column); 465 return gtk_tree_view_column_get_max_width(gtkTreeViewColumn); 466 } 467 468 /** 469 * Emits the "clicked" signal on the column. This function will only work if 470 * tree_column is clickable. 471 */ 472 public void clicked() 473 { 474 // void gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column); 475 gtk_tree_view_column_clicked(gtkTreeViewColumn); 476 } 477 478 /** 479 * Sets the title of the tree_column. If a custom widget has been set, then 480 * this value is ignored. 481 * Params: 482 * title = The title of the tree_column. 483 */ 484 public void setTitle(string title) 485 { 486 // void gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column, const gchar *title); 487 gtk_tree_view_column_set_title(gtkTreeViewColumn, Str.toStringz(title)); 488 } 489 490 /** 491 * Returns the title of the widget. 492 * Returns: the title of the column. This string should not be modified or freed. 493 */ 494 public string getTitle() 495 { 496 // const gchar * gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column); 497 return Str.toString(gtk_tree_view_column_get_title(gtkTreeViewColumn)); 498 } 499 500 /** 501 * Sets the column to take available extra space. This space is shared equally 502 * amongst all columns that have the expand set to TRUE. If no column has this 503 * option set, then the last column gets all extra space. By default, every 504 * column is created with this FALSE. 505 * Along with "fixed-width", the "expand" property changes when the column is 506 * resized by the user. 507 * Since 2.4 508 * Params: 509 * expand = TRUE if the column should expand to fill available space. 510 */ 511 public void setExpand(int expand) 512 { 513 // void gtk_tree_view_column_set_expand (GtkTreeViewColumn *tree_column, gboolean expand); 514 gtk_tree_view_column_set_expand(gtkTreeViewColumn, expand); 515 } 516 517 /** 518 * Returns TRUE if the column expands to fill available space. 519 * Since 2.4 520 * Returns: TRUE if the column expands to fill available space. 521 */ 522 public int getExpand() 523 { 524 // gboolean gtk_tree_view_column_get_expand (GtkTreeViewColumn *tree_column); 525 return gtk_tree_view_column_get_expand(gtkTreeViewColumn); 526 } 527 528 /** 529 * Sets the header to be active if clickable is TRUE. When the header is 530 * active, then it can take keyboard focus, and can be clicked. 531 * Params: 532 * clickable = TRUE if the header is active. 533 */ 534 public void setClickable(int clickable) 535 { 536 // void gtk_tree_view_column_set_clickable (GtkTreeViewColumn *tree_column, gboolean clickable); 537 gtk_tree_view_column_set_clickable(gtkTreeViewColumn, clickable); 538 } 539 540 /** 541 * Returns TRUE if the user can click on the header for the column. 542 * Returns: TRUE if user can click the column header. 543 */ 544 public int getClickable() 545 { 546 // gboolean gtk_tree_view_column_get_clickable (GtkTreeViewColumn *tree_column); 547 return gtk_tree_view_column_get_clickable(gtkTreeViewColumn); 548 } 549 550 /** 551 * Sets the widget in the header to be widget. If widget is NULL, then the 552 * header button is set with a GtkLabel set to the title of tree_column. 553 * Params: 554 * widget = A child GtkWidget, or NULL. [allow-none] 555 */ 556 public void setWidget(Widget widget) 557 { 558 // void gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column, GtkWidget *widget); 559 gtk_tree_view_column_set_widget(gtkTreeViewColumn, (widget is null) ? null : widget.getWidgetStruct()); 560 } 561 562 /** 563 * Returns the GtkWidget in the button on the column header. 564 * If a custom widget has not been set then NULL is returned. 565 * Returns: The GtkWidget in the column header, or NULL. [transfer none] 566 */ 567 public Widget getWidget() 568 { 569 // GtkWidget * gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column); 570 auto p = gtk_tree_view_column_get_widget(gtkTreeViewColumn); 571 572 if(p is null) 573 { 574 return null; 575 } 576 577 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 578 } 579 580 /** 581 * Sets the alignment of the title or custom widget inside the column header. 582 * The alignment determines its location inside the button -- 0.0 for left, 0.5 583 * for center, 1.0 for right. 584 * Params: 585 * xalign = The alignment, which is between [0.0 and 1.0] inclusive. 586 */ 587 public void setAlignment(float xalign) 588 { 589 // void gtk_tree_view_column_set_alignment (GtkTreeViewColumn *tree_column, gfloat xalign); 590 gtk_tree_view_column_set_alignment(gtkTreeViewColumn, xalign); 591 } 592 593 /** 594 * Returns the current x alignment of tree_column. This value can range 595 * between 0.0 and 1.0. 596 * Returns: The current alignent of tree_column. 597 */ 598 public float getAlignment() 599 { 600 // gfloat gtk_tree_view_column_get_alignment (GtkTreeViewColumn *tree_column); 601 return gtk_tree_view_column_get_alignment(gtkTreeViewColumn); 602 } 603 604 /** 605 * If reorderable is TRUE, then the column can be reordered by the end user 606 * dragging the header. 607 * Params: 608 * reorderable = TRUE, if the column can be reordered. 609 */ 610 public void setReorderable(int reorderable) 611 { 612 // void gtk_tree_view_column_set_reorderable (GtkTreeViewColumn *tree_column, gboolean reorderable); 613 gtk_tree_view_column_set_reorderable(gtkTreeViewColumn, reorderable); 614 } 615 616 /** 617 * Returns TRUE if the tree_column can be reordered by the user. 618 * Returns: TRUE if the tree_column can be reordered by the user. 619 */ 620 public int getReorderable() 621 { 622 // gboolean gtk_tree_view_column_get_reorderable (GtkTreeViewColumn *tree_column); 623 return gtk_tree_view_column_get_reorderable(gtkTreeViewColumn); 624 } 625 626 /** 627 * Sets the logical sort_column_id that this column sorts on when this column 628 * is selected for sorting. Doing so makes the column header clickable. 629 * Params: 630 * sortColumnId = The sort_column_id of the model to sort on. 631 */ 632 public void setSortColumnId(int sortColumnId) 633 { 634 // void gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column, gint sort_column_id); 635 gtk_tree_view_column_set_sort_column_id(gtkTreeViewColumn, sortColumnId); 636 } 637 638 /** 639 * Gets the logical sort_column_id that the model sorts on when this 640 * column is selected for sorting. 641 * See gtk_tree_view_column_set_sort_column_id(). 642 * Returns: the current sort_column_id for this column, or -1 if this column can't be used for sorting. 643 */ 644 public int getSortColumnId() 645 { 646 // gint gtk_tree_view_column_get_sort_column_id (GtkTreeViewColumn *tree_column); 647 return gtk_tree_view_column_get_sort_column_id(gtkTreeViewColumn); 648 } 649 650 /** 651 * Call this function with a setting of TRUE to display an arrow in 652 * the header button indicating the column is sorted. Call 653 * gtk_tree_view_column_set_sort_order() to change the direction of 654 * the arrow. 655 * Params: 656 * setting = TRUE to display an indicator that the column is sorted 657 */ 658 public void setSortIndicator(int setting) 659 { 660 // void gtk_tree_view_column_set_sort_indicator (GtkTreeViewColumn *tree_column, gboolean setting); 661 gtk_tree_view_column_set_sort_indicator(gtkTreeViewColumn, setting); 662 } 663 664 /** 665 * Gets the value set by gtk_tree_view_column_set_sort_indicator(). 666 * Returns: whether the sort indicator arrow is displayed 667 */ 668 public int getSortIndicator() 669 { 670 // gboolean gtk_tree_view_column_get_sort_indicator (GtkTreeViewColumn *tree_column); 671 return gtk_tree_view_column_get_sort_indicator(gtkTreeViewColumn); 672 } 673 674 /** 675 * Changes the appearance of the sort indicator. 676 * This does not actually sort the model. Use 677 * gtk_tree_view_column_set_sort_column_id() if you want automatic sorting 678 * support. This function is primarily for custom sorting behavior, and should 679 * be used in conjunction with gtk_tree_sortable_set_sort_column_id() to do 680 * that. For custom models, the mechanism will vary. 681 * The sort indicator changes direction to indicate normal sort or reverse sort. 682 * Note that you must have the sort indicator enabled to see anything when 683 * calling this function; see gtk_tree_view_column_set_sort_indicator(). 684 * Params: 685 * order = sort order that the sort indicator should indicate 686 */ 687 public void setSortOrder(GtkSortType order) 688 { 689 // void gtk_tree_view_column_set_sort_order (GtkTreeViewColumn *tree_column, GtkSortType order); 690 gtk_tree_view_column_set_sort_order(gtkTreeViewColumn, order); 691 } 692 693 /** 694 * Gets the value set by gtk_tree_view_column_set_sort_order(). 695 * Returns: the sort order the sort indicator is indicating 696 */ 697 public GtkSortType getSortOrder() 698 { 699 // GtkSortType gtk_tree_view_column_get_sort_order (GtkTreeViewColumn *tree_column); 700 return gtk_tree_view_column_get_sort_order(gtkTreeViewColumn); 701 } 702 703 /** 704 * Sets the cell renderer based on the tree_model and iter. That is, for 705 * every attribute mapping in tree_column, it will get a value from the set 706 * column on the iter, and use that value to set the attribute on the cell 707 * renderer. This is used primarily by the GtkTreeView. 708 * Params: 709 * treeModel = The GtkTreeModel to to get the cell renderers attributes from. 710 * iter = The GtkTreeIter to to get the cell renderer's attributes from. 711 * isExpander = TRUE, if the row has children 712 * isExpanded = TRUE, if the row has visible children 713 */ 714 public void cellSetCellData(TreeModelIF treeModel, TreeIter iter, int isExpander, int isExpanded) 715 { 716 // void gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column, GtkTreeModel *tree_model, GtkTreeIter *iter, gboolean is_expander, gboolean is_expanded); 717 gtk_tree_view_column_cell_set_cell_data(gtkTreeViewColumn, (treeModel is null) ? null : treeModel.getTreeModelTStruct(), (iter is null) ? null : iter.getTreeIterStruct(), isExpander, isExpanded); 718 } 719 720 /** 721 * Obtains the width and height needed to render the column. This is used 722 * primarily by the GtkTreeView. 723 * Params: 724 * cellArea = The area a cell in the column will be allocated, or NULL. [allow-none] 725 * xOffset = location to return x offset of a cell relative to cell_area, or NULL. [out][allow-none] 726 * yOffset = location to return y offset of a cell relative to cell_area, or NULL. [out][allow-none] 727 * width = location to return width needed to render a cell, or NULL. [out][allow-none] 728 * height = location to return height needed to render a cell, or NULL. [out][allow-none] 729 */ 730 public void cellGetSize(ref Rectangle cellArea, out int xOffset, out int yOffset, out int width, out int height) 731 { 732 // void gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column, const GdkRectangle *cell_area, gint *x_offset, gint *y_offset, gint *width, gint *height); 733 gtk_tree_view_column_cell_get_size(gtkTreeViewColumn, &cellArea, &xOffset, &yOffset, &width, &height); 734 } 735 736 /** 737 * Obtains the horizontal position and size of a cell in a column. If the 738 * cell is not found in the column, start_pos and width are not changed and 739 * FALSE is returned. 740 * Params: 741 * cellRenderer = a GtkCellRenderer 742 * xOffset = return location for the horizontal 743 * position of cell within tree_column, may be NULL. [out][allow-none] 744 * width = return location for the width of cell, 745 * may be NULL. [out][allow-none] 746 * Returns: TRUE if cell belongs to tree_column. 747 */ 748 public int cellGetPosition(CellRenderer cellRenderer, out int xOffset, out int width) 749 { 750 // gboolean gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell_renderer, gint *x_offset, gint *width); 751 return gtk_tree_view_column_cell_get_position(gtkTreeViewColumn, (cellRenderer is null) ? null : cellRenderer.getCellRendererStruct(), &xOffset, &width); 752 } 753 754 /** 755 * Returns TRUE if any of the cells packed into the tree_column are visible. 756 * For this to be meaningful, you must first initialize the cells with 757 * gtk_tree_view_column_cell_set_cell_data() 758 * Returns: TRUE, if any of the cells packed into the tree_column are currently visible 759 */ 760 public int cellIsVisible() 761 { 762 // gboolean gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *tree_column); 763 return gtk_tree_view_column_cell_is_visible(gtkTreeViewColumn); 764 } 765 766 /** 767 * Sets the current keyboard focus to be at cell, if the column contains 768 * 2 or more editable and activatable cells. 769 * Since 2.2 770 * Params: 771 * cell = A GtkCellRenderer 772 */ 773 public void focusCell(CellRenderer cell) 774 { 775 // void gtk_tree_view_column_focus_cell (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell); 776 gtk_tree_view_column_focus_cell(gtkTreeViewColumn, (cell is null) ? null : cell.getCellRendererStruct()); 777 } 778 779 /** 780 * Flags the column, and the cell renderers added to this column, to have 781 * their sizes renegotiated. 782 * Since 2.8 783 */ 784 public void queueResize() 785 { 786 // void gtk_tree_view_column_queue_resize (GtkTreeViewColumn *tree_column); 787 gtk_tree_view_column_queue_resize(gtkTreeViewColumn); 788 } 789 790 /** 791 * Returns the current X offset of tree_column in pixels. 792 * Returns: The current X offset of tree_column. Since 3.2 793 */ 794 public int getXOffset() 795 { 796 // gint gtk_tree_view_column_get_x_offset (GtkTreeViewColumn *tree_column); 797 return gtk_tree_view_column_get_x_offset(gtkTreeViewColumn); 798 } 799 }