1
2@c %start of fragment
3
4@deftp Class <gtk-tree-view-column>
5Derives from @code{<gtk-buildable>}, @code{<gtk-cell-layout>},
6@code{<gtk-object>}.
7
8This class defines the following slots:
9
10@table @code
11@item visible
12Whether to display the column
13
14@item resizable
15Column is user-resizable
16
17@item width
18Current width of the column
19
20@item spacing
21Space which is inserted between cells
22
23@item sizing
24Resize mode of the column
25
26@item fixed-width
27Current fixed width of the column
28
29@item min-width
30Minimum allowed width of the column
31
32@item max-width
33Maximum allowed width of the column
34
35@item title
36Title to appear in column header
37
38@item expand
39Column gets share of extra width allocated to the widget
40
41@item clickable
42Whether the header can be clicked
43
44@item widget
45Widget to put in column header button instead of column title
46
47@item alignment
48X Alignment of the column header text or widget
49
50@item reorderable
51Whether the column can be reordered around the headers
52
53@item sort-indicator
54Whether to show a sort indicator
55
56@item sort-order
57Sort direction the sort indicator should indicate
58
59@end table
60
61@end deftp
62
63@defop Signal <gtk-tree-view-column> clicked
64@end defop
65
66@deffn Function gtk-tree-view-column-new  @result{}@tie{} (ret@tie{}@code{<gtk-tree-view-column>})
67Creates a new @code{<gtk-tree-view-column>}.
68
69@table @var
70@item ret
71A newly created @code{<gtk-tree-view-column>}.
72
73@end table
74
75@end deffn
76
77@deffn Function gtk-tree-view-column-pack-start  (self@tie{}@code{<gtk-tree-view-column>}) (cell@tie{}@code{<gtk-cell-renderer>}) (expand@tie{}@code{bool})
78@deffnx Method pack-start
79Packs the @var{cell} into the beginning of the column. If @var{expand} is
80@samp{@code{#f}}, then the @var{cell} is allocated no more space than it needs.
81Any unused space is divided evenly between cells for which @var{expand} is
82@samp{@code{#t}}.
83
84@table @var
85@item tree-column
86A @code{<gtk-tree-view-column>}.
87
88@item cell
89The @code{<gtk-cell-renderer>}.
90
91@item expand
92@samp{@code{#t}} if @var{cell} is to be given extra space allocated to
93@var{tree-column}.
94
95@end table
96
97@end deffn
98
99@deffn Function gtk-tree-view-column-pack-end  (self@tie{}@code{<gtk-tree-view-column>}) (cell@tie{}@code{<gtk-cell-renderer>}) (expand@tie{}@code{bool})
100@deffnx Method pack-end
101Adds the @var{cell} to end of the column. If @var{expand} is @samp{@code{#f}},
102then the @var{cell} is allocated no more space than it needs. Any unused space
103is divided evenly between cells for which @var{expand} is @samp{@code{#t}}.
104
105@table @var
106@item tree-column
107A @code{<gtk-tree-view-column>}.
108
109@item cell
110The @code{<gtk-cell-renderer>}.
111
112@item expand
113@samp{@code{#t}} if @var{cell} is to be given extra space allocated to
114@var{tree-column}.
115
116@end table
117
118@end deffn
119
120@deffn Function gtk-tree-view-column-clear  (self@tie{}@code{<gtk-tree-view-column>})
121@deffnx Method clear
122Unsets all the mappings on all renderers on the @var{tree-column}.
123
124@table @var
125@item tree-column
126A @code{<gtk-tree-view-column>}
127
128@end table
129
130@end deffn
131
132@deffn Function gtk-tree-view-column-add-attribute  (self@tie{}@code{<gtk-tree-view-column>}) (cell_renderer@tie{}@code{<gtk-cell-renderer>}) (attribute@tie{}@code{mchars}) (column@tie{}@code{int})
133@deffnx Method add-attribute
134Adds an attribute mapping to the list in @var{tree-column}. The @var{column} is
135the column of the model to get a value from, and the @var{attribute} is the
136parameter on @var{cell-renderer} to be set from the value. So for example if
137column 2 of the model contains strings, you could have the "text" attribute of a
138@code{<gtk-cell-renderer-text>} get its values from column 2.
139
140@table @var
141@item tree-column
142A @code{<gtk-tree-view-column>}.
143
144@item cell-renderer
145the @code{<gtk-cell-renderer>} to set attributes on
146
147@item attribute
148An attribute on the renderer
149
150@item column
151The column position on the model to get the attribute from.
152
153@end table
154
155@end deffn
156
157@deffn Function gtk-tree-view-column-set-spacing  (self@tie{}@code{<gtk-tree-view-column>}) (spacing@tie{}@code{int})
158@deffnx Method set-spacing
159Sets the spacing field of @var{tree-column}, which is the number of pixels to
160place between cell renderers packed into it.
161
162@table @var
163@item tree-column
164A @code{<gtk-tree-view-column>}.
165
166@item spacing
167distance between cell renderers in pixels.
168
169@end table
170
171@end deffn
172
173@deffn Function gtk-tree-view-column-get-spacing  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{int})
174@deffnx Method get-spacing
175Returns the spacing of @var{tree-column}.
176
177@table @var
178@item tree-column
179A @code{<gtk-tree-view-column>}.
180
181@item ret
182the spacing of @var{tree-column}.
183
184@end table
185
186@end deffn
187
188@deffn Function gtk-tree-view-column-set-visible  (self@tie{}@code{<gtk-tree-view-column>}) (visible@tie{}@code{bool})
189@deffnx Method set-visible
190Sets the visibility of @var{tree-column}.
191
192@table @var
193@item tree-column
194A @code{<gtk-tree-view-column>}.
195
196@item visible
197@samp{@code{#t}} if the @var{tree-column} is visible.
198
199@end table
200
201@end deffn
202
203@deffn Function gtk-tree-view-column-get-visible  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{bool})
204@deffnx Method get-visible
205Returns @samp{@code{#t}} if @var{tree-column} is visible.
206
207@table @var
208@item tree-column
209A @code{<gtk-tree-view-column>}.
210
211@item ret
212whether the column is visible or not. If it is visible, then the tree will show
213the column.
214
215@end table
216
217@end deffn
218
219@deffn Function gtk-tree-view-column-set-resizable  (self@tie{}@code{<gtk-tree-view-column>}) (resizable@tie{}@code{bool})
220@deffnx Method set-resizable
221If @var{resizable} is @samp{@code{#t}}, then the user can explicitly resize the
222column by grabbing the outer edge of the column button. If resizable is
223@samp{@code{#t}} and sizing mode of the column is
224@code{<gtk-tree-view-column-autosize>}, then the sizing mode is changed to
225@code{<gtk-tree-view-column-grow-only>}.
226
227@table @var
228@item tree-column
229A @code{<gtk-tree-view-column>}
230
231@item resizable
232@samp{@code{#t}}, if the column can be resized
233
234@end table
235
236@end deffn
237
238@deffn Function gtk-tree-view-column-get-resizable  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{bool})
239@deffnx Method get-resizable
240Returns @samp{@code{#t}} if the @var{tree-column} can be resized by the end
241user.
242
243@table @var
244@item tree-column
245A @code{<gtk-tree-view-column>}
246
247@item ret
248@samp{@code{#t}}, if the @var{tree-column} can be resized.
249
250@end table
251
252@end deffn
253
254@deffn Function gtk-tree-view-column-set-sizing  (self@tie{}@code{<gtk-tree-view-column>}) (type@tie{}@code{<gtk-tree-view-column-sizing>})
255@deffnx Method set-sizing
256Sets the growth behavior of @var{tree-column} to @var{type}.
257
258@table @var
259@item tree-column
260A @code{<gtk-tree-view-column>}.
261
262@item type
263The @code{<gtk-tree-view-column-sizing>}.
264
265@end table
266
267@end deffn
268
269@deffn Function gtk-tree-view-column-get-sizing  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{<gtk-tree-view-column-sizing>})
270@deffnx Method get-sizing
271Returns the current type of @var{tree-column}.
272
273@table @var
274@item tree-column
275A @code{<gtk-tree-view-column>}.
276
277@item ret
278The type of @var{tree-column}.
279
280@end table
281
282@end deffn
283
284@deffn Function gtk-tree-view-column-get-width  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{int})
285@deffnx Method get-width
286Returns the current size of @var{tree-column} in pixels.
287
288@table @var
289@item tree-column
290A @code{<gtk-tree-view-column>}.
291
292@item ret
293The current width of @var{tree-column}.
294
295@end table
296
297@end deffn
298
299@deffn Function gtk-tree-view-column-set-min-width  (self@tie{}@code{<gtk-tree-view-column>}) (min_width@tie{}@code{int})
300@deffnx Method set-min-width
301Sets the minimum width of the @var{tree-column}. If @var{min-width} is -1, then
302the minimum width is unset.
303
304@table @var
305@item tree-column
306A @code{<gtk-tree-view-column>}.
307
308@item min-width
309The minimum width of the column in pixels, or -1.
310
311@end table
312
313@end deffn
314
315@deffn Function gtk-tree-view-column-get-min-width  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{int})
316@deffnx Method get-min-width
317Returns the minimum width in pixels of the @var{tree-column}, or -1 if no
318minimum width is set.
319
320@table @var
321@item tree-column
322A @code{<gtk-tree-view-column>}.
323
324@item ret
325The minimum width of the @var{tree-column}.
326
327@end table
328
329@end deffn
330
331@deffn Function gtk-tree-view-column-set-max-width  (self@tie{}@code{<gtk-tree-view-column>}) (max_width@tie{}@code{int})
332@deffnx Method set-max-width
333Sets the maximum width of the @var{tree-column}. If @var{max-width} is -1, then
334the maximum width is unset. Note, the column can actually be wider than max
335width if it's the last column in a view. In this case, the column expands to
336fill any extra space.
337
338@table @var
339@item tree-column
340A @code{<gtk-tree-view-column>}.
341
342@item max-width
343The maximum width of the column in pixels, or -1.
344
345@end table
346
347@end deffn
348
349@deffn Function gtk-tree-view-column-get-max-width  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{int})
350@deffnx Method get-max-width
351Returns the maximum width in pixels of the @var{tree-column}, or -1 if no
352maximum width is set.
353
354@table @var
355@item tree-column
356A @code{<gtk-tree-view-column>}.
357
358@item ret
359The maximum width of the @var{tree-column}.
360
361@end table
362
363@end deffn
364
365@deffn Function gtk-tree-view-column-clicked  (self@tie{}@code{<gtk-tree-view-column>})
366@deffnx Method clicked
367Emits the "clicked" signal on the column. This function will only work if
368@var{tree-column} is clickable.
369
370@table @var
371@item tree-column
372a @code{<gtk-tree-view-column>}
373
374@end table
375
376@end deffn
377
378@deffn Function gtk-tree-view-column-set-title  (self@tie{}@code{<gtk-tree-view-column>}) (title@tie{}@code{mchars})
379@deffnx Method set-title
380Sets the title of the @var{tree-column}. If a custom widget has been set, then
381this value is ignored.
382
383@table @var
384@item tree-column
385A @code{<gtk-tree-view-column>}.
386
387@item title
388The title of the @var{tree-column}.
389
390@end table
391
392@end deffn
393
394@deffn Function gtk-tree-view-column-get-title  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{mchars})
395@deffnx Method get-title
396Returns the title of the widget.
397
398@table @var
399@item tree-column
400A @code{<gtk-tree-view-column>}.
401
402@item ret
403the title of the column. This string should not be modified or freed.
404
405@end table
406
407@end deffn
408
409@deffn Function gtk-tree-view-column-set-expand  (self@tie{}@code{<gtk-tree-view-column>}) (expand@tie{}@code{bool})
410@deffnx Method set-expand
411Sets the column to take available extra space. This space is shared equally
412amongst all columns that have the expand set to @samp{@code{#t}}. If no column
413has this option set, then the last column gets all extra space. By default,
414every column is created with this @samp{@code{#f}}.
415
416@table @var
417@item tree-column
418A @code{<gtk-tree-view-column>}
419
420@item expand
421@samp{@code{#t}} if the column should take available extra space,
422@samp{@code{#f}} if not
423
424@end table
425
426Since 2.4
427
428@end deffn
429
430@deffn Function gtk-tree-view-column-get-expand  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{bool})
431@deffnx Method get-expand
432Return @samp{@code{#t}} if the column expands to take any available space.
433
434@table @var
435@item tree-column
436a @code{<gtk-tree-view-column>}
437
438@item ret
439@samp{@code{#t}}, if the column expands
440
441@end table
442
443Since 2.4
444
445@end deffn
446
447@deffn Function gtk-tree-view-column-set-clickable  (self@tie{}@code{<gtk-tree-view-column>}) (clickable@tie{}@code{bool})
448@deffnx Method set-clickable
449Sets the header to be active if @var{active} is @samp{@code{#t}}. When the
450header is active, then it can take keyboard focus, and can be clicked.
451
452@table @var
453@item tree-column
454A @code{<gtk-tree-view-column>}.
455
456@item clickable
457@samp{@code{#t}} if the header is active.
458
459@end table
460
461@end deffn
462
463@deffn Function gtk-tree-view-column-get-clickable  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{bool})
464@deffnx Method get-clickable
465Returns @samp{@code{#t}} if the user can click on the header for the column.
466
467@table @var
468@item tree-column
469a @code{<gtk-tree-view-column>}
470
471@item ret
472@samp{@code{#t}} if user can click the column header.
473
474@end table
475
476@end deffn
477
478@deffn Function gtk-tree-view-column-set-widget  (self@tie{}@code{<gtk-tree-view-column>}) (widget@tie{}@code{<gtk-widget>})
479@deffnx Method set-widget
480Sets the widget in the header to be @var{widget}. If widget is @samp{@code{#f}},
481then the header button is set with a @code{<gtk-label>} set to the title of
482@var{tree-column}.
483
484@table @var
485@item tree-column
486A @code{<gtk-tree-view-column>}.
487
488@item widget
489A child @code{<gtk-widget>}, or @samp{@code{#f}}.
490
491@end table
492
493@end deffn
494
495@deffn Function gtk-tree-view-column-get-widget  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{<gtk-widget>})
496@deffnx Method get-widget
497Returns the @code{<gtk-widget>} in the button on the column header. If a custom
498widget has not been set then @samp{@code{#f}} is returned.
499
500@table @var
501@item tree-column
502A @code{<gtk-tree-view-column>}.
503
504@item ret
505The @code{<gtk-widget>} in the column header, or @samp{@code{#f}}
506
507@end table
508
509@end deffn
510
511@deffn Function gtk-tree-view-column-set-alignment  (self@tie{}@code{<gtk-tree-view-column>}) (xalign@tie{}@code{float})
512@deffnx Method set-alignment
513Sets the alignment of the title or custom widget inside the column header. The
514alignment determines its location inside the button -- 0.0 for left, 0.5 for
515center, 1.0 for right.
516
517@table @var
518@item tree-column
519A @code{<gtk-tree-view-column>}.
520
521@item xalign
522The alignment, which is between [0.0 and 1.0] inclusive.
523
524@end table
525
526@end deffn
527
528@deffn Function gtk-tree-view-column-get-alignment  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{float})
529@deffnx Method get-alignment
530Returns the current x alignment of @var{tree-column}. This value can range
531between 0.0 and 1.0.
532
533@table @var
534@item tree-column
535A @code{<gtk-tree-view-column>}.
536
537@item ret
538The current alignent of @var{tree-column}.
539
540@end table
541
542@end deffn
543
544@deffn Function gtk-tree-view-column-set-sort-order  (self@tie{}@code{<gtk-tree-view-column>}) (order@tie{}@code{<gtk-sort-type>})
545@deffnx Method set-sort-order
546Changes the appearance of the sort indicator.
547
548This @emph{does not} actually sort the model. Use
549@code{gtk-tree-view-column-set-sort-column-id} if you want automatic sorting
550support. This function is primarily for custom sorting behavior, and should be
551used in conjunction with @code{gtk-tree-sortable-set-sort-column} to do that.
552For custom models, the mechanism will vary.
553
554The sort indicator changes direction to indicate normal sort or reverse sort.
555Note that you must have the sort indicator enabled to see anything when calling
556this function; see @code{gtk-tree-view-column-set-sort-indicator}.
557
558@table @var
559@item tree-column
560a @code{<gtk-tree-view-column>}
561
562@item order
563sort order that the sort indicator should indicate
564
565@end table
566
567@end deffn
568
569@deffn Function gtk-tree-view-column-get-sort-order  (self@tie{}@code{<gtk-tree-view-column>}) @result{}@tie{} (ret@tie{}@code{<gtk-sort-type>})
570@deffnx Method get-sort-order
571Gets the value set by @code{gtk-tree-view-column-set-sort-order}.
572
573@table @var
574@item tree-column
575a @code{<gtk-tree-view-column>}
576
577@item ret
578the sort order the sort indicator is indicating
579
580@end table
581
582@end deffn
583
584@deffn Function gtk-tree-view-column-focus-cell  (self@tie{}@code{<gtk-tree-view-column>}) (cell@tie{}@code{<gtk-cell-renderer>})
585@deffnx Method focus-cell
586Sets the current keyboard focus to be at @var{cell}, if the column contains 2 or
587more editable and activatable cells.
588
589@table @var
590@item tree-column
591A @code{<gtk-tree-view-column>}
592
593@item cell
594A @code{<gtk-cell-renderer>}
595
596@end table
597
598Since 2.2
599
600@end deffn
601
602@deffn Function gtk-tree-view-column-queue-resize  (self@tie{}@code{<gtk-tree-view-column>})
603@deffnx Method queue-resize
604Flags the column, and the cell renderers added to this column, to have their
605sizes renegotiated.
606
607@table @var
608@item tree-column
609A @code{<gtk-tree-view-column>}
610
611@end table
612
613Since 2.8
614
615@end deffn
616
617
618@c %end of fragment
619