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