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