Skip to main content

gtk4/auto/
tree_view_column.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4#![allow(deprecated)]
5
6use crate::{
7    Buildable, CellArea, CellLayout, CellRenderer, SortType, TreeIter, TreeModel,
8    TreeViewColumnSizing, Widget, ffi,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{SignalHandlerId, connect_raw},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// Use [`ColumnView`][crate::ColumnView] and [`ColumnViewColumn`][crate::ColumnViewColumn]
20    ///   instead of [`TreeView`][crate::TreeView] to show a tabular list
21    /// A visible column in a [`TreeView`][crate::TreeView] widget
22    ///
23    /// The [`TreeViewColumn`][crate::TreeViewColumn] object represents a visible column in a [`TreeView`][crate::TreeView] widget.
24    /// It allows to set properties of the column header, and functions as a holding pen
25    /// for the cell renderers which determine how the data in the column is displayed.
26    ///
27    /// Please refer to the [tree widget conceptual overview](section-tree-widget.html)
28    /// for an overview of all the objects and data types related to the tree widget and
29    /// how they work together, and to the [`TreeView`][crate::TreeView] documentation for specifics
30    /// about the CSS node structure for treeviews and their headers.
31    ///
32    /// ## Properties
33    ///
34    ///
35    /// #### `alignment`
36    ///  Readable | Writeable
37    ///
38    ///
39    /// #### `cell-area`
40    ///  The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
41    ///
42    /// If no area is specified when creating the tree view column with gtk_tree_view_column_new_with_area()
43    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
44    ///
45    /// Readable | Writeable | Construct Only
46    ///
47    ///
48    /// #### `clickable`
49    ///  Readable | Writeable
50    ///
51    ///
52    /// #### `expand`
53    ///  Readable | Writeable
54    ///
55    ///
56    /// #### `fixed-width`
57    ///  Readable | Writeable
58    ///
59    ///
60    /// #### `max-width`
61    ///  Readable | Writeable
62    ///
63    ///
64    /// #### `min-width`
65    ///  Readable | Writeable
66    ///
67    ///
68    /// #### `reorderable`
69    ///  Readable | Writeable
70    ///
71    ///
72    /// #### `resizable`
73    ///  Readable | Writeable
74    ///
75    ///
76    /// #### `sizing`
77    ///  Readable | Writeable
78    ///
79    ///
80    /// #### `sort-column-id`
81    ///  Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
82    /// clickable. Set to -1 to make the column unsortable.
83    ///
84    /// Readable | Writeable
85    ///
86    ///
87    /// #### `sort-indicator`
88    ///  Readable | Writeable
89    ///
90    ///
91    /// #### `sort-order`
92    ///  Readable | Writeable
93    ///
94    ///
95    /// #### `spacing`
96    ///  Readable | Writeable
97    ///
98    ///
99    /// #### `title`
100    ///  Readable | Writeable
101    ///
102    ///
103    /// #### `visible`
104    ///  Readable | Writeable
105    ///
106    ///
107    /// #### `widget`
108    ///  Readable | Writeable
109    ///
110    ///
111    /// #### `width`
112    ///  Readable
113    ///
114    ///
115    /// #### `x-offset`
116    ///  Readable
117    ///
118    /// ## Signals
119    ///
120    ///
121    /// #### `clicked`
122    ///  Emitted when the column's header has been clicked.
123    ///
124    ///
125    ///
126    /// # Implements
127    ///
128    /// [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`CellLayoutExt`][trait@crate::prelude::CellLayoutExt], [`CellLayoutExtManual`][trait@crate::prelude::CellLayoutExtManual]
129    #[doc(alias = "GtkTreeViewColumn")]
130    pub struct TreeViewColumn(Object<ffi::GtkTreeViewColumn>) @implements Buildable, CellLayout;
131
132    match fn {
133        type_ => || ffi::gtk_tree_view_column_get_type(),
134    }
135}
136
137impl TreeViewColumn {
138    /// Creates a new [`TreeViewColumn`][crate::TreeViewColumn].
139    ///
140    /// # Deprecated since 4.10
141    ///
142    /// Use GtkColumnView instead
143    ///
144    /// # Returns
145    ///
146    /// A newly created [`TreeViewColumn`][crate::TreeViewColumn].
147    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
148    #[allow(deprecated)]
149    #[doc(alias = "gtk_tree_view_column_new")]
150    pub fn new() -> TreeViewColumn {
151        assert_initialized_main_thread!();
152        unsafe { from_glib_none(ffi::gtk_tree_view_column_new()) }
153    }
154
155    /// Creates a new [`TreeViewColumn`][crate::TreeViewColumn] using @area to render its cells.
156    ///
157    /// # Deprecated since 4.10
158    ///
159    /// Use GtkColumnView instead
160    /// ## `area`
161    /// the [`CellArea`][crate::CellArea] that the newly created column should use to layout cells.
162    ///
163    /// # Returns
164    ///
165    /// A newly created [`TreeViewColumn`][crate::TreeViewColumn].
166    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
167    #[allow(deprecated)]
168    #[doc(alias = "gtk_tree_view_column_new_with_area")]
169    #[doc(alias = "new_with_area")]
170    pub fn with_area(area: &impl IsA<CellArea>) -> TreeViewColumn {
171        skip_assert_initialized!();
172        unsafe {
173            from_glib_none(ffi::gtk_tree_view_column_new_with_area(
174                area.as_ref().to_glib_none().0,
175            ))
176        }
177    }
178
179    // rustdoc-stripper-ignore-next
180    /// Creates a new builder-pattern struct instance to construct [`TreeViewColumn`] objects.
181    ///
182    /// This method returns an instance of [`TreeViewColumnBuilder`](crate::builders::TreeViewColumnBuilder) which can be used to create [`TreeViewColumn`] objects.
183    pub fn builder() -> TreeViewColumnBuilder {
184        TreeViewColumnBuilder::new()
185    }
186
187    /// Adds an attribute mapping to the list in @self.
188    ///
189    /// The @column is the
190    /// column of the model to get a value from, and the @attribute is the
191    /// parameter on @cell_renderer to be set from the value. So for example
192    /// if column 2 of the model contains strings, you could have the
193    /// “text” attribute of a [`CellRendererText`][crate::CellRendererText] get its values from
194    /// column 2.
195    ///
196    /// # Deprecated since 4.10
197    ///
198    /// Use GtkColumnView instead
199    /// ## `cell_renderer`
200    /// the [`CellRenderer`][crate::CellRenderer] to set attributes on
201    /// ## `attribute`
202    /// An attribute on the renderer
203    /// ## `column`
204    /// The column position on the model to get the attribute from.
205    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
206    #[allow(deprecated)]
207    #[doc(alias = "gtk_tree_view_column_add_attribute")]
208    pub fn add_attribute(
209        &self,
210        cell_renderer: &impl IsA<CellRenderer>,
211        attribute: &str,
212        column: i32,
213    ) {
214        unsafe {
215            ffi::gtk_tree_view_column_add_attribute(
216                self.to_glib_none().0,
217                cell_renderer.as_ref().to_glib_none().0,
218                attribute.to_glib_none().0,
219                column,
220            );
221        }
222    }
223
224    /// Obtains the horizontal position and size of a cell in a column.
225    ///
226    /// If the  cell is not found in the column, @start_pos and @width
227    /// are not changed and [`false`] is returned.
228    ///
229    /// # Deprecated since 4.10
230    ///
231    /// Use GtkColumnView instead
232    /// ## `cell_renderer`
233    /// a [`CellRenderer`][crate::CellRenderer]
234    ///
235    /// # Returns
236    ///
237    /// [`true`] if @cell belongs to @self
238    ///
239    /// ## `x_offset`
240    /// return location for the horizontal
241    ///   position of @cell within @self
242    ///
243    /// ## `width`
244    /// return location for the width of @cell
245    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
246    #[allow(deprecated)]
247    #[doc(alias = "gtk_tree_view_column_cell_get_position")]
248    pub fn cell_get_position(&self, cell_renderer: &impl IsA<CellRenderer>) -> Option<(i32, i32)> {
249        unsafe {
250            let mut x_offset = std::mem::MaybeUninit::uninit();
251            let mut width = std::mem::MaybeUninit::uninit();
252            let ret = from_glib(ffi::gtk_tree_view_column_cell_get_position(
253                self.to_glib_none().0,
254                cell_renderer.as_ref().to_glib_none().0,
255                x_offset.as_mut_ptr(),
256                width.as_mut_ptr(),
257            ));
258            if ret {
259                Some((x_offset.assume_init(), width.assume_init()))
260            } else {
261                None
262            }
263        }
264    }
265
266    /// Obtains the width and height needed to render the column.  This is used
267    /// primarily by the [`TreeView`][crate::TreeView].
268    ///
269    /// # Deprecated since 4.10
270    ///
271    /// Use GtkColumnView instead
272    ///
273    /// # Returns
274    ///
275    ///
276    /// ## `x_offset`
277    /// location to return x offset of a cell relative to @cell_area
278    ///
279    /// ## `y_offset`
280    /// location to return y offset of a cell relative to @cell_area
281    ///
282    /// ## `width`
283    /// location to return width needed to render a cell
284    ///
285    /// ## `height`
286    /// location to return height needed to render a cell
287    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
288    #[allow(deprecated)]
289    #[doc(alias = "gtk_tree_view_column_cell_get_size")]
290    pub fn cell_get_size(&self) -> (i32, i32, i32, i32) {
291        unsafe {
292            let mut x_offset = std::mem::MaybeUninit::uninit();
293            let mut y_offset = std::mem::MaybeUninit::uninit();
294            let mut width = std::mem::MaybeUninit::uninit();
295            let mut height = std::mem::MaybeUninit::uninit();
296            ffi::gtk_tree_view_column_cell_get_size(
297                self.to_glib_none().0,
298                x_offset.as_mut_ptr(),
299                y_offset.as_mut_ptr(),
300                width.as_mut_ptr(),
301                height.as_mut_ptr(),
302            );
303            (
304                x_offset.assume_init(),
305                y_offset.assume_init(),
306                width.assume_init(),
307                height.assume_init(),
308            )
309        }
310    }
311
312    /// Returns [`true`] if any of the cells packed into the @self are visible.
313    /// For this to be meaningful, you must first initialize the cells with
314    /// gtk_tree_view_column_cell_set_cell_data()
315    ///
316    /// # Deprecated since 4.10
317    ///
318    /// Use GtkColumnView instead
319    ///
320    /// # Returns
321    ///
322    /// [`true`], if any of the cells packed into the @self are currently visible
323    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
324    #[allow(deprecated)]
325    #[doc(alias = "gtk_tree_view_column_cell_is_visible")]
326    pub fn cell_is_visible(&self) -> bool {
327        unsafe {
328            from_glib(ffi::gtk_tree_view_column_cell_is_visible(
329                self.to_glib_none().0,
330            ))
331        }
332    }
333
334    /// Sets the cell renderer based on the @tree_model and @iter.  That is, for
335    /// every attribute mapping in @self, it will get a value from the set
336    /// column on the @iter, and use that value to set the attribute on the cell
337    /// renderer.  This is used primarily by the [`TreeView`][crate::TreeView].
338    ///
339    /// # Deprecated since 4.10
340    ///
341    /// Use GtkColumnView instead
342    /// ## `tree_model`
343    /// The [`TreeModel`][crate::TreeModel] to get the cell renderers attributes from.
344    /// ## `iter`
345    /// The [`TreeIter`][crate::TreeIter] to get the cell renderer’s attributes from.
346    /// ## `is_expander`
347    /// [`true`], if the row has children
348    /// ## `is_expanded`
349    /// [`true`], if the row has visible children
350    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
351    #[allow(deprecated)]
352    #[doc(alias = "gtk_tree_view_column_cell_set_cell_data")]
353    pub fn cell_set_cell_data(
354        &self,
355        tree_model: &impl IsA<TreeModel>,
356        iter: &TreeIter,
357        is_expander: bool,
358        is_expanded: bool,
359    ) {
360        unsafe {
361            ffi::gtk_tree_view_column_cell_set_cell_data(
362                self.to_glib_none().0,
363                tree_model.as_ref().to_glib_none().0,
364                mut_override(iter.to_glib_none().0),
365                is_expander.into_glib(),
366                is_expanded.into_glib(),
367            );
368        }
369    }
370
371    /// Unsets all the mappings on all renderers on the @self.
372    ///
373    /// # Deprecated since 4.10
374    ///
375    /// Use GtkColumnView instead
376    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
377    #[allow(deprecated)]
378    #[doc(alias = "gtk_tree_view_column_clear")]
379    pub fn clear(&self) {
380        unsafe {
381            ffi::gtk_tree_view_column_clear(self.to_glib_none().0);
382        }
383    }
384
385    /// Clears all existing attributes previously set with
386    /// gtk_tree_view_column_set_attributes().
387    ///
388    /// # Deprecated since 4.10
389    ///
390    /// Use GtkColumnView instead
391    /// ## `cell_renderer`
392    /// a [`CellRenderer`][crate::CellRenderer] to clear the attribute mapping on.
393    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
394    #[allow(deprecated)]
395    #[doc(alias = "gtk_tree_view_column_clear_attributes")]
396    pub fn clear_attributes(&self, cell_renderer: &impl IsA<CellRenderer>) {
397        unsafe {
398            ffi::gtk_tree_view_column_clear_attributes(
399                self.to_glib_none().0,
400                cell_renderer.as_ref().to_glib_none().0,
401            );
402        }
403    }
404
405    /// Emits the “clicked” signal on the column.  This function will only work if
406    /// @self is clickable.
407    ///
408    /// # Deprecated since 4.10
409    ///
410    /// Use GtkColumnView instead
411    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
412    #[allow(deprecated)]
413    #[doc(alias = "gtk_tree_view_column_clicked")]
414    pub fn clicked(&self) {
415        unsafe {
416            ffi::gtk_tree_view_column_clicked(self.to_glib_none().0);
417        }
418    }
419
420    /// Sets the current keyboard focus to be at @cell, if the column contains
421    /// 2 or more editable and activatable cells.
422    ///
423    /// # Deprecated since 4.10
424    ///
425    /// Use GtkColumnView instead
426    /// ## `cell`
427    /// A [`CellRenderer`][crate::CellRenderer]
428    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
429    #[allow(deprecated)]
430    #[doc(alias = "gtk_tree_view_column_focus_cell")]
431    pub fn focus_cell(&self, cell: &impl IsA<CellRenderer>) {
432        unsafe {
433            ffi::gtk_tree_view_column_focus_cell(
434                self.to_glib_none().0,
435                cell.as_ref().to_glib_none().0,
436            );
437        }
438    }
439
440    /// Returns the current x alignment of @self.  This value can range
441    /// between 0.0 and 1.0.
442    ///
443    /// # Deprecated since 4.10
444    ///
445    /// Use GtkColumnView instead
446    ///
447    /// # Returns
448    ///
449    /// The current alignent of @self.
450    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
451    #[allow(deprecated)]
452    #[doc(alias = "gtk_tree_view_column_get_alignment")]
453    #[doc(alias = "get_alignment")]
454    pub fn alignment(&self) -> f32 {
455        unsafe { ffi::gtk_tree_view_column_get_alignment(self.to_glib_none().0) }
456    }
457
458    /// Returns the button used in the treeview column header
459    ///
460    /// # Deprecated since 4.10
461    ///
462    /// Use GtkColumnView instead
463    ///
464    /// # Returns
465    ///
466    /// The button for the column header.
467    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
468    #[allow(deprecated)]
469    #[doc(alias = "gtk_tree_view_column_get_button")]
470    #[doc(alias = "get_button")]
471    pub fn button(&self) -> Widget {
472        unsafe { from_glib_none(ffi::gtk_tree_view_column_get_button(self.to_glib_none().0)) }
473    }
474
475    /// Returns [`true`] if the user can click on the header for the column.
476    ///
477    /// # Deprecated since 4.10
478    ///
479    /// Use GtkColumnView instead
480    ///
481    /// # Returns
482    ///
483    /// [`true`] if user can click the column header.
484    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
485    #[allow(deprecated)]
486    #[doc(alias = "gtk_tree_view_column_get_clickable")]
487    #[doc(alias = "get_clickable")]
488    #[doc(alias = "clickable")]
489    pub fn is_clickable(&self) -> bool {
490        unsafe {
491            from_glib(ffi::gtk_tree_view_column_get_clickable(
492                self.to_glib_none().0,
493            ))
494        }
495    }
496
497    /// Returns [`true`] if the column expands to fill available space.
498    ///
499    /// # Deprecated since 4.10
500    ///
501    /// Use GtkColumnView instead
502    ///
503    /// # Returns
504    ///
505    /// [`true`] if the column expands to fill available space.
506    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
507    #[allow(deprecated)]
508    #[doc(alias = "gtk_tree_view_column_get_expand")]
509    #[doc(alias = "get_expand")]
510    #[doc(alias = "expand")]
511    pub fn expands(&self) -> bool {
512        unsafe { from_glib(ffi::gtk_tree_view_column_get_expand(self.to_glib_none().0)) }
513    }
514
515    /// Gets the fixed width of the column.  This may not be the actual displayed
516    /// width of the column; for that, use gtk_tree_view_column_get_width().
517    ///
518    /// # Deprecated since 4.10
519    ///
520    /// Use GtkColumnView instead
521    ///
522    /// # Returns
523    ///
524    /// The fixed width of the column.
525    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
526    #[allow(deprecated)]
527    #[doc(alias = "gtk_tree_view_column_get_fixed_width")]
528    #[doc(alias = "get_fixed_width")]
529    #[doc(alias = "fixed-width")]
530    pub fn fixed_width(&self) -> i32 {
531        unsafe { ffi::gtk_tree_view_column_get_fixed_width(self.to_glib_none().0) }
532    }
533
534    /// Returns the maximum width in pixels of the @self, or -1 if no maximum
535    /// width is set.
536    ///
537    /// # Deprecated since 4.10
538    ///
539    /// Use GtkColumnView instead
540    ///
541    /// # Returns
542    ///
543    /// The maximum width of the @self.
544    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
545    #[allow(deprecated)]
546    #[doc(alias = "gtk_tree_view_column_get_max_width")]
547    #[doc(alias = "get_max_width")]
548    #[doc(alias = "max-width")]
549    pub fn max_width(&self) -> i32 {
550        unsafe { ffi::gtk_tree_view_column_get_max_width(self.to_glib_none().0) }
551    }
552
553    /// Returns the minimum width in pixels of the @self, or -1 if no minimum
554    /// width is set.
555    ///
556    /// # Deprecated since 4.10
557    ///
558    /// Use GtkColumnView instead
559    ///
560    /// # Returns
561    ///
562    /// The minimum width of the @self.
563    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
564    #[allow(deprecated)]
565    #[doc(alias = "gtk_tree_view_column_get_min_width")]
566    #[doc(alias = "get_min_width")]
567    #[doc(alias = "min-width")]
568    pub fn min_width(&self) -> i32 {
569        unsafe { ffi::gtk_tree_view_column_get_min_width(self.to_glib_none().0) }
570    }
571
572    /// Returns [`true`] if the @self can be reordered by the user.
573    ///
574    /// # Deprecated since 4.10
575    ///
576    /// Use GtkColumnView instead
577    ///
578    /// # Returns
579    ///
580    /// [`true`] if the @self can be reordered by the user.
581    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
582    #[allow(deprecated)]
583    #[doc(alias = "gtk_tree_view_column_get_reorderable")]
584    #[doc(alias = "get_reorderable")]
585    #[doc(alias = "reorderable")]
586    pub fn is_reorderable(&self) -> bool {
587        unsafe {
588            from_glib(ffi::gtk_tree_view_column_get_reorderable(
589                self.to_glib_none().0,
590            ))
591        }
592    }
593
594    /// Returns [`true`] if the @self can be resized by the end user.
595    ///
596    /// # Deprecated since 4.10
597    ///
598    /// Use GtkColumnView instead
599    ///
600    /// # Returns
601    ///
602    /// [`true`], if the @self can be resized.
603    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
604    #[allow(deprecated)]
605    #[doc(alias = "gtk_tree_view_column_get_resizable")]
606    #[doc(alias = "get_resizable")]
607    #[doc(alias = "resizable")]
608    pub fn is_resizable(&self) -> bool {
609        unsafe {
610            from_glib(ffi::gtk_tree_view_column_get_resizable(
611                self.to_glib_none().0,
612            ))
613        }
614    }
615
616    /// Returns the current type of @self.
617    ///
618    /// # Deprecated since 4.10
619    ///
620    /// Use GtkColumnView instead
621    ///
622    /// # Returns
623    ///
624    /// The type of @self.
625    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
626    #[allow(deprecated)]
627    #[doc(alias = "gtk_tree_view_column_get_sizing")]
628    #[doc(alias = "get_sizing")]
629    pub fn sizing(&self) -> TreeViewColumnSizing {
630        unsafe { from_glib(ffi::gtk_tree_view_column_get_sizing(self.to_glib_none().0)) }
631    }
632
633    /// Gets the logical @sort_column_id that the model sorts on
634    /// when this column is selected for sorting.
635    ///
636    /// See [`set_sort_column_id()`][Self::set_sort_column_id()].
637    ///
638    /// # Deprecated since 4.10
639    ///
640    /// Use GtkColumnView instead
641    ///
642    /// # Returns
643    ///
644    /// the current @sort_column_id for this column, or -1 if
645    ///   this column can’t be used for sorting
646    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
647    #[allow(deprecated)]
648    #[doc(alias = "gtk_tree_view_column_get_sort_column_id")]
649    #[doc(alias = "get_sort_column_id")]
650    #[doc(alias = "sort-column-id")]
651    pub fn sort_column_id(&self) -> i32 {
652        unsafe { ffi::gtk_tree_view_column_get_sort_column_id(self.to_glib_none().0) }
653    }
654
655    /// Gets the value set by gtk_tree_view_column_set_sort_indicator().
656    ///
657    /// # Deprecated since 4.10
658    ///
659    /// Use GtkColumnView instead
660    ///
661    /// # Returns
662    ///
663    /// whether the sort indicator arrow is displayed
664    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
665    #[allow(deprecated)]
666    #[doc(alias = "gtk_tree_view_column_get_sort_indicator")]
667    #[doc(alias = "get_sort_indicator")]
668    #[doc(alias = "sort-indicator")]
669    pub fn is_sort_indicator(&self) -> bool {
670        unsafe {
671            from_glib(ffi::gtk_tree_view_column_get_sort_indicator(
672                self.to_glib_none().0,
673            ))
674        }
675    }
676
677    /// Gets the value set by gtk_tree_view_column_set_sort_order().
678    ///
679    /// # Deprecated since 4.10
680    ///
681    /// Use GtkColumnView instead
682    ///
683    /// # Returns
684    ///
685    /// the sort order the sort indicator is indicating
686    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
687    #[allow(deprecated)]
688    #[doc(alias = "gtk_tree_view_column_get_sort_order")]
689    #[doc(alias = "get_sort_order")]
690    #[doc(alias = "sort-order")]
691    pub fn sort_order(&self) -> SortType {
692        unsafe {
693            from_glib(ffi::gtk_tree_view_column_get_sort_order(
694                self.to_glib_none().0,
695            ))
696        }
697    }
698
699    /// Returns the spacing of @self.
700    ///
701    /// # Deprecated since 4.10
702    ///
703    /// Use GtkColumnView instead
704    ///
705    /// # Returns
706    ///
707    /// the spacing of @self.
708    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
709    #[allow(deprecated)]
710    #[doc(alias = "gtk_tree_view_column_get_spacing")]
711    #[doc(alias = "get_spacing")]
712    pub fn spacing(&self) -> i32 {
713        unsafe { ffi::gtk_tree_view_column_get_spacing(self.to_glib_none().0) }
714    }
715
716    /// Returns the title of the widget.
717    ///
718    /// # Deprecated since 4.10
719    ///
720    /// Use GtkColumnView instead
721    ///
722    /// # Returns
723    ///
724    /// the title of the column. This string should not be
725    /// modified or freed.
726    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
727    #[allow(deprecated)]
728    #[doc(alias = "gtk_tree_view_column_get_title")]
729    #[doc(alias = "get_title")]
730    pub fn title(&self) -> glib::GString {
731        unsafe { from_glib_none(ffi::gtk_tree_view_column_get_title(self.to_glib_none().0)) }
732    }
733
734    /// Returns the [`TreeView`][crate::TreeView] wherein @self has been inserted.
735    /// If @column is currently not inserted in any tree view, [`None`] is
736    /// returned.
737    ///
738    /// # Deprecated since 4.10
739    ///
740    /// Use GtkColumnView instead
741    ///
742    /// # Returns
743    ///
744    /// The tree view wherein @column
745    ///   has been inserted
746    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
747    #[allow(deprecated)]
748    #[doc(alias = "gtk_tree_view_column_get_tree_view")]
749    #[doc(alias = "get_tree_view")]
750    pub fn tree_view(&self) -> Option<Widget> {
751        unsafe {
752            from_glib_none(ffi::gtk_tree_view_column_get_tree_view(
753                self.to_glib_none().0,
754            ))
755        }
756    }
757
758    /// Returns [`true`] if @self is visible.
759    ///
760    /// # Deprecated since 4.10
761    ///
762    /// Use GtkColumnView instead
763    ///
764    /// # Returns
765    ///
766    /// whether the column is visible or not.  If it is visible, then
767    /// the tree will show the column.
768    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
769    #[allow(deprecated)]
770    #[doc(alias = "gtk_tree_view_column_get_visible")]
771    #[doc(alias = "get_visible")]
772    #[doc(alias = "visible")]
773    pub fn is_visible(&self) -> bool {
774        unsafe { from_glib(ffi::gtk_tree_view_column_get_visible(self.to_glib_none().0)) }
775    }
776
777    /// Returns the [`Widget`][crate::Widget] in the button on the column header.
778    ///
779    /// If a custom widget has not been set then [`None`] is returned.
780    ///
781    /// # Deprecated since 4.10
782    ///
783    /// Use GtkColumnView instead
784    ///
785    /// # Returns
786    ///
787    /// The [`Widget`][crate::Widget] in the column header
788    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
789    #[allow(deprecated)]
790    #[doc(alias = "gtk_tree_view_column_get_widget")]
791    #[doc(alias = "get_widget")]
792    pub fn widget(&self) -> Option<Widget> {
793        unsafe { from_glib_none(ffi::gtk_tree_view_column_get_widget(self.to_glib_none().0)) }
794    }
795
796    /// Returns the current size of @self in pixels.
797    ///
798    /// # Deprecated since 4.10
799    ///
800    /// Use GtkColumnView instead
801    ///
802    /// # Returns
803    ///
804    /// The current width of @self.
805    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
806    #[allow(deprecated)]
807    #[doc(alias = "gtk_tree_view_column_get_width")]
808    #[doc(alias = "get_width")]
809    pub fn width(&self) -> i32 {
810        unsafe { ffi::gtk_tree_view_column_get_width(self.to_glib_none().0) }
811    }
812
813    /// Returns the current X offset of @self in pixels.
814    ///
815    /// # Deprecated since 4.10
816    ///
817    /// Use GtkColumnView instead
818    ///
819    /// # Returns
820    ///
821    /// The current X offset of @self.
822    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
823    #[allow(deprecated)]
824    #[doc(alias = "gtk_tree_view_column_get_x_offset")]
825    #[doc(alias = "get_x_offset")]
826    #[doc(alias = "x-offset")]
827    pub fn x_offset(&self) -> i32 {
828        unsafe { ffi::gtk_tree_view_column_get_x_offset(self.to_glib_none().0) }
829    }
830
831    /// Adds the @cell to end of the column. If @expand is [`false`], then the @cell
832    /// is allocated no more space than it needs. Any unused space is divided
833    /// evenly between cells for which @expand is [`true`].
834    ///
835    /// # Deprecated since 4.10
836    ///
837    /// Use GtkColumnView instead
838    /// ## `cell`
839    /// The [`CellRenderer`][crate::CellRenderer]
840    /// ## `expand`
841    /// [`true`] if @cell is to be given extra space allocated to @self.
842    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
843    #[allow(deprecated)]
844    #[doc(alias = "gtk_tree_view_column_pack_end")]
845    pub fn pack_end(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
846        unsafe {
847            ffi::gtk_tree_view_column_pack_end(
848                self.to_glib_none().0,
849                cell.as_ref().to_glib_none().0,
850                expand.into_glib(),
851            );
852        }
853    }
854
855    /// Packs the @cell into the beginning of the column. If @expand is [`false`], then
856    /// the @cell is allocated no more space than it needs. Any unused space is divided
857    /// evenly between cells for which @expand is [`true`].
858    ///
859    /// # Deprecated since 4.10
860    ///
861    /// Use GtkColumnView instead
862    /// ## `cell`
863    /// The [`CellRenderer`][crate::CellRenderer]
864    /// ## `expand`
865    /// [`true`] if @cell is to be given extra space allocated to @self.
866    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
867    #[allow(deprecated)]
868    #[doc(alias = "gtk_tree_view_column_pack_start")]
869    pub fn pack_start(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
870        unsafe {
871            ffi::gtk_tree_view_column_pack_start(
872                self.to_glib_none().0,
873                cell.as_ref().to_glib_none().0,
874                expand.into_glib(),
875            );
876        }
877    }
878
879    /// Flags the column, and the cell renderers added to this column, to have
880    /// their sizes renegotiated.
881    ///
882    /// # Deprecated since 4.10
883    ///
884    /// Use GtkColumnView instead
885    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
886    #[allow(deprecated)]
887    #[doc(alias = "gtk_tree_view_column_queue_resize")]
888    pub fn queue_resize(&self) {
889        unsafe {
890            ffi::gtk_tree_view_column_queue_resize(self.to_glib_none().0);
891        }
892    }
893
894    /// Sets the alignment of the title or custom widget inside the column header.
895    /// The alignment determines its location inside the button -- 0.0 for left, 0.5
896    /// for center, 1.0 for right.
897    ///
898    /// # Deprecated since 4.10
899    ///
900    /// Use GtkColumnView instead
901    /// ## `xalign`
902    /// The alignment, which is between [0.0 and 1.0] inclusive.
903    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
904    #[allow(deprecated)]
905    #[doc(alias = "gtk_tree_view_column_set_alignment")]
906    #[doc(alias = "alignment")]
907    pub fn set_alignment(&self, xalign: f32) {
908        unsafe {
909            ffi::gtk_tree_view_column_set_alignment(self.to_glib_none().0, xalign);
910        }
911    }
912
913    /// Sets the `GtkTreeCellDataFunc` to use for the column.
914    ///
915    /// This
916    /// function is used instead of the standard attributes mapping for
917    /// setting the column value, and should set the value of @self's
918    /// cell renderer as appropriate.  @func may be [`None`] to remove an
919    /// older one.
920    ///
921    /// # Deprecated since 4.10
922    ///
923    /// Use GtkColumnView instead
924    /// ## `cell_renderer`
925    /// A [`CellRenderer`][crate::CellRenderer]
926    /// ## `func`
927    /// The `GtkTreeCellDataFunc` to use.
928    /// ## `func_data`
929    /// The user data for @func.
930    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
931    #[allow(deprecated)]
932    #[doc(alias = "gtk_tree_view_column_set_cell_data_func")]
933    pub fn set_cell_data_func<
934        P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
935    >(
936        &self,
937        cell_renderer: &impl IsA<CellRenderer>,
938        func: P,
939    ) {
940        let func_data: Box_<P> = Box_::new(func);
941        unsafe extern "C" fn func_func<
942            P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
943        >(
944            tree_column: *mut ffi::GtkTreeViewColumn,
945            cell: *mut ffi::GtkCellRenderer,
946            tree_model: *mut ffi::GtkTreeModel,
947            iter: *mut ffi::GtkTreeIter,
948            data: glib::ffi::gpointer,
949        ) {
950            unsafe {
951                let tree_column = from_glib_borrow(tree_column);
952                let cell = from_glib_borrow(cell);
953                let tree_model = from_glib_borrow(tree_model);
954                let iter = from_glib_borrow(iter);
955                let callback = &*(data as *mut P);
956                (*callback)(&tree_column, &cell, &tree_model, &iter)
957            }
958        }
959        let func = Some(func_func::<P> as _);
960        unsafe extern "C" fn destroy_func<
961            P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
962        >(
963            data: glib::ffi::gpointer,
964        ) {
965            unsafe {
966                let _callback = Box_::from_raw(data as *mut P);
967            }
968        }
969        let destroy_call4 = Some(destroy_func::<P> as _);
970        let super_callback0: Box_<P> = func_data;
971        unsafe {
972            ffi::gtk_tree_view_column_set_cell_data_func(
973                self.to_glib_none().0,
974                cell_renderer.as_ref().to_glib_none().0,
975                func,
976                Box_::into_raw(super_callback0) as *mut _,
977                destroy_call4,
978            );
979        }
980    }
981
982    /// Sets the header to be active if @clickable is [`true`].  When the header is
983    /// active, then it can take keyboard focus, and can be clicked.
984    ///
985    /// # Deprecated since 4.10
986    ///
987    /// Use GtkColumnView instead
988    /// ## `clickable`
989    /// [`true`] if the header is active.
990    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
991    #[allow(deprecated)]
992    #[doc(alias = "gtk_tree_view_column_set_clickable")]
993    #[doc(alias = "clickable")]
994    pub fn set_clickable(&self, clickable: bool) {
995        unsafe {
996            ffi::gtk_tree_view_column_set_clickable(self.to_glib_none().0, clickable.into_glib());
997        }
998    }
999
1000    /// Sets the column to take available extra space.  This space is shared equally
1001    /// amongst all columns that have the expand set to [`true`].  If no column has this
1002    /// option set, then the last column gets all extra space.  By default, every
1003    /// column is created with this [`false`].
1004    ///
1005    /// Along with “fixed-width”, the “expand” property changes when the column is
1006    /// resized by the user.
1007    ///
1008    /// # Deprecated since 4.10
1009    ///
1010    /// Use GtkColumnView instead
1011    /// ## `expand`
1012    /// [`true`] if the column should expand to fill available space.
1013    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1014    #[allow(deprecated)]
1015    #[doc(alias = "gtk_tree_view_column_set_expand")]
1016    #[doc(alias = "expand")]
1017    pub fn set_expand(&self, expand: bool) {
1018        unsafe {
1019            ffi::gtk_tree_view_column_set_expand(self.to_glib_none().0, expand.into_glib());
1020        }
1021    }
1022
1023    /// If @fixed_width is not -1, sets the fixed width of @self; otherwise
1024    /// unsets it.  The effective value of @fixed_width is clamped between the
1025    /// minimum and maximum width of the column; however, the value stored in the
1026    /// “fixed-width” property is not clamped.  If the column sizing is
1027    /// [`TreeViewColumnSizing::GrowOnly`][crate::TreeViewColumnSizing::GrowOnly] or [`TreeViewColumnSizing::Autosize`][crate::TreeViewColumnSizing::Autosize], setting
1028    /// a fixed width overrides the automatically calculated width.  Note that
1029    /// @fixed_width is only a hint to GTK; the width actually allocated to the
1030    /// column may be greater or less than requested.
1031    ///
1032    /// Along with “expand”, the “fixed-width” property changes when the column is
1033    /// resized by the user.
1034    ///
1035    /// # Deprecated since 4.10
1036    ///
1037    /// Use GtkColumnView instead
1038    /// ## `fixed_width`
1039    /// The new fixed width, in pixels, or -1.
1040    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1041    #[allow(deprecated)]
1042    #[doc(alias = "gtk_tree_view_column_set_fixed_width")]
1043    #[doc(alias = "fixed-width")]
1044    pub fn set_fixed_width(&self, fixed_width: i32) {
1045        unsafe {
1046            ffi::gtk_tree_view_column_set_fixed_width(self.to_glib_none().0, fixed_width);
1047        }
1048    }
1049
1050    /// Sets the maximum width of the @self.  If @max_width is -1, then the
1051    /// maximum width is unset.  Note, the column can actually be wider than max
1052    /// width if it’s the last column in a view.  In this case, the column expands to
1053    /// fill any extra space.
1054    ///
1055    /// # Deprecated since 4.10
1056    ///
1057    /// Use GtkColumnView instead
1058    /// ## `max_width`
1059    /// The maximum width of the column in pixels, or -1.
1060    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1061    #[allow(deprecated)]
1062    #[doc(alias = "gtk_tree_view_column_set_max_width")]
1063    #[doc(alias = "max-width")]
1064    pub fn set_max_width(&self, max_width: i32) {
1065        unsafe {
1066            ffi::gtk_tree_view_column_set_max_width(self.to_glib_none().0, max_width);
1067        }
1068    }
1069
1070    /// Sets the minimum width of the @self.  If @min_width is -1, then the
1071    /// minimum width is unset.
1072    ///
1073    /// # Deprecated since 4.10
1074    ///
1075    /// Use GtkColumnView instead
1076    /// ## `min_width`
1077    /// The minimum width of the column in pixels, or -1.
1078    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1079    #[allow(deprecated)]
1080    #[doc(alias = "gtk_tree_view_column_set_min_width")]
1081    #[doc(alias = "min-width")]
1082    pub fn set_min_width(&self, min_width: i32) {
1083        unsafe {
1084            ffi::gtk_tree_view_column_set_min_width(self.to_glib_none().0, min_width);
1085        }
1086    }
1087
1088    /// If @reorderable is [`true`], then the column can be reordered by the end user
1089    /// dragging the header.
1090    ///
1091    /// # Deprecated since 4.10
1092    ///
1093    /// Use GtkColumnView instead
1094    /// ## `reorderable`
1095    /// [`true`], if the column can be reordered.
1096    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1097    #[allow(deprecated)]
1098    #[doc(alias = "gtk_tree_view_column_set_reorderable")]
1099    #[doc(alias = "reorderable")]
1100    pub fn set_reorderable(&self, reorderable: bool) {
1101        unsafe {
1102            ffi::gtk_tree_view_column_set_reorderable(
1103                self.to_glib_none().0,
1104                reorderable.into_glib(),
1105            );
1106        }
1107    }
1108
1109    /// If @resizable is [`true`], then the user can explicitly resize the column by
1110    /// grabbing the outer edge of the column button.
1111    ///
1112    /// If resizable is [`true`] and
1113    /// sizing mode of the column is [`TreeViewColumnSizing::Autosize`][crate::TreeViewColumnSizing::Autosize], then the sizing
1114    /// mode is changed to [`TreeViewColumnSizing::GrowOnly`][crate::TreeViewColumnSizing::GrowOnly].
1115    ///
1116    /// # Deprecated since 4.10
1117    ///
1118    /// Use GtkColumnView instead
1119    /// ## `resizable`
1120    /// [`true`], if the column can be resized
1121    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1122    #[allow(deprecated)]
1123    #[doc(alias = "gtk_tree_view_column_set_resizable")]
1124    #[doc(alias = "resizable")]
1125    pub fn set_resizable(&self, resizable: bool) {
1126        unsafe {
1127            ffi::gtk_tree_view_column_set_resizable(self.to_glib_none().0, resizable.into_glib());
1128        }
1129    }
1130
1131    /// Sets the growth behavior of @self to @type_.
1132    ///
1133    /// # Deprecated since 4.10
1134    ///
1135    /// Use GtkColumnView instead
1136    /// ## `type_`
1137    /// The [`TreeViewColumn`][crate::TreeViewColumn]Sizing.
1138    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1139    #[allow(deprecated)]
1140    #[doc(alias = "gtk_tree_view_column_set_sizing")]
1141    #[doc(alias = "sizing")]
1142    pub fn set_sizing(&self, type_: TreeViewColumnSizing) {
1143        unsafe {
1144            ffi::gtk_tree_view_column_set_sizing(self.to_glib_none().0, type_.into_glib());
1145        }
1146    }
1147
1148    /// Sets the logical @sort_column_id that this column sorts on when this column
1149    /// is selected for sorting.  Doing so makes the column header clickable.
1150    ///
1151    /// # Deprecated since 4.10
1152    ///
1153    /// Use GtkColumnView instead
1154    /// ## `sort_column_id`
1155    /// The @sort_column_id of the model to sort on.
1156    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1157    #[allow(deprecated)]
1158    #[doc(alias = "gtk_tree_view_column_set_sort_column_id")]
1159    #[doc(alias = "sort-column-id")]
1160    pub fn set_sort_column_id(&self, sort_column_id: i32) {
1161        unsafe {
1162            ffi::gtk_tree_view_column_set_sort_column_id(self.to_glib_none().0, sort_column_id);
1163        }
1164    }
1165
1166    /// Call this function with a @setting of [`true`] to display an arrow in
1167    /// the header button indicating the column is sorted. Call
1168    /// gtk_tree_view_column_set_sort_order() to change the direction of
1169    /// the arrow.
1170    ///
1171    /// # Deprecated since 4.10
1172    ///
1173    /// Use GtkColumnView instead
1174    /// ## `setting`
1175    /// [`true`] to display an indicator that the column is sorted
1176    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1177    #[allow(deprecated)]
1178    #[doc(alias = "gtk_tree_view_column_set_sort_indicator")]
1179    #[doc(alias = "sort-indicator")]
1180    pub fn set_sort_indicator(&self, setting: bool) {
1181        unsafe {
1182            ffi::gtk_tree_view_column_set_sort_indicator(
1183                self.to_glib_none().0,
1184                setting.into_glib(),
1185            );
1186        }
1187    }
1188
1189    /// Changes the appearance of the sort indicator.
1190    ///
1191    /// This does not actually sort the model.  Use
1192    /// gtk_tree_view_column_set_sort_column_id() if you want automatic sorting
1193    /// support.  This function is primarily for custom sorting behavior, and should
1194    /// be used in conjunction with gtk_tree_sortable_set_sort_column_id() to do
1195    /// that. For custom models, the mechanism will vary.
1196    ///
1197    /// The sort indicator changes direction to indicate normal sort or reverse sort.
1198    /// Note that you must have the sort indicator enabled to see anything when
1199    /// calling this function; see gtk_tree_view_column_set_sort_indicator().
1200    ///
1201    /// # Deprecated since 4.10
1202    ///
1203    /// Use GtkColumnView instead
1204    /// ## `order`
1205    /// sort order that the sort indicator should indicate
1206    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1207    #[allow(deprecated)]
1208    #[doc(alias = "gtk_tree_view_column_set_sort_order")]
1209    #[doc(alias = "sort-order")]
1210    pub fn set_sort_order(&self, order: SortType) {
1211        unsafe {
1212            ffi::gtk_tree_view_column_set_sort_order(self.to_glib_none().0, order.into_glib());
1213        }
1214    }
1215
1216    /// Sets the spacing field of @self, which is the number of pixels to
1217    /// place between cell renderers packed into it.
1218    ///
1219    /// # Deprecated since 4.10
1220    ///
1221    /// Use GtkColumnView instead
1222    /// ## `spacing`
1223    /// distance between cell renderers in pixels.
1224    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1225    #[allow(deprecated)]
1226    #[doc(alias = "gtk_tree_view_column_set_spacing")]
1227    #[doc(alias = "spacing")]
1228    pub fn set_spacing(&self, spacing: i32) {
1229        unsafe {
1230            ffi::gtk_tree_view_column_set_spacing(self.to_glib_none().0, spacing);
1231        }
1232    }
1233
1234    /// Sets the title of the @self.  If a custom widget has been set, then
1235    /// this value is ignored.
1236    ///
1237    /// # Deprecated since 4.10
1238    ///
1239    /// Use GtkColumnView instead
1240    /// ## `title`
1241    /// The title of the @self.
1242    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1243    #[allow(deprecated)]
1244    #[doc(alias = "gtk_tree_view_column_set_title")]
1245    #[doc(alias = "title")]
1246    pub fn set_title(&self, title: &str) {
1247        unsafe {
1248            ffi::gtk_tree_view_column_set_title(self.to_glib_none().0, title.to_glib_none().0);
1249        }
1250    }
1251
1252    /// Sets the visibility of @self.
1253    ///
1254    /// # Deprecated since 4.10
1255    ///
1256    /// Use GtkColumnView instead
1257    /// ## `visible`
1258    /// [`true`] if the @self is visible.
1259    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1260    #[allow(deprecated)]
1261    #[doc(alias = "gtk_tree_view_column_set_visible")]
1262    #[doc(alias = "visible")]
1263    pub fn set_visible(&self, visible: bool) {
1264        unsafe {
1265            ffi::gtk_tree_view_column_set_visible(self.to_glib_none().0, visible.into_glib());
1266        }
1267    }
1268
1269    /// Sets the widget in the header to be @widget.  If widget is [`None`], then the
1270    /// header button is set with a [`Label`][crate::Label] set to the title of @self.
1271    ///
1272    /// # Deprecated since 4.10
1273    ///
1274    /// Use GtkColumnView instead
1275    /// ## `widget`
1276    /// A child [`Widget`][crate::Widget]
1277    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1278    #[allow(deprecated)]
1279    #[doc(alias = "gtk_tree_view_column_set_widget")]
1280    #[doc(alias = "widget")]
1281    pub fn set_widget(&self, widget: Option<&impl IsA<Widget>>) {
1282        unsafe {
1283            ffi::gtk_tree_view_column_set_widget(
1284                self.to_glib_none().0,
1285                widget.map(|p| p.as_ref()).to_glib_none().0,
1286            );
1287        }
1288    }
1289
1290    /// The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
1291    ///
1292    /// If no area is specified when creating the tree view column with gtk_tree_view_column_new_with_area()
1293    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
1294    #[doc(alias = "cell-area")]
1295    pub fn cell_area(&self) -> Option<CellArea> {
1296        ObjectExt::property(self, "cell-area")
1297    }
1298
1299    /// Emitted when the column's header has been clicked.
1300    #[doc(alias = "clicked")]
1301    pub fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1302        unsafe extern "C" fn clicked_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1303            this: *mut ffi::GtkTreeViewColumn,
1304            f: glib::ffi::gpointer,
1305        ) {
1306            unsafe {
1307                let f: &F = &*(f as *const F);
1308                f(&from_glib_borrow(this))
1309            }
1310        }
1311        unsafe {
1312            let f: Box_<F> = Box_::new(f);
1313            connect_raw(
1314                self.as_ptr() as *mut _,
1315                c"clicked".as_ptr() as *const _,
1316                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1317                    clicked_trampoline::<F> as *const (),
1318                )),
1319                Box_::into_raw(f),
1320            )
1321        }
1322    }
1323
1324    #[doc(alias = "alignment")]
1325    pub fn connect_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1326        unsafe extern "C" fn notify_alignment_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1327            this: *mut ffi::GtkTreeViewColumn,
1328            _param_spec: glib::ffi::gpointer,
1329            f: glib::ffi::gpointer,
1330        ) {
1331            unsafe {
1332                let f: &F = &*(f as *const F);
1333                f(&from_glib_borrow(this))
1334            }
1335        }
1336        unsafe {
1337            let f: Box_<F> = Box_::new(f);
1338            connect_raw(
1339                self.as_ptr() as *mut _,
1340                c"notify::alignment".as_ptr() as *const _,
1341                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1342                    notify_alignment_trampoline::<F> as *const (),
1343                )),
1344                Box_::into_raw(f),
1345            )
1346        }
1347    }
1348
1349    #[doc(alias = "clickable")]
1350    pub fn connect_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1351        unsafe extern "C" fn notify_clickable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1352            this: *mut ffi::GtkTreeViewColumn,
1353            _param_spec: glib::ffi::gpointer,
1354            f: glib::ffi::gpointer,
1355        ) {
1356            unsafe {
1357                let f: &F = &*(f as *const F);
1358                f(&from_glib_borrow(this))
1359            }
1360        }
1361        unsafe {
1362            let f: Box_<F> = Box_::new(f);
1363            connect_raw(
1364                self.as_ptr() as *mut _,
1365                c"notify::clickable".as_ptr() as *const _,
1366                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1367                    notify_clickable_trampoline::<F> as *const (),
1368                )),
1369                Box_::into_raw(f),
1370            )
1371        }
1372    }
1373
1374    #[doc(alias = "expand")]
1375    pub fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1376        unsafe extern "C" fn notify_expand_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1377            this: *mut ffi::GtkTreeViewColumn,
1378            _param_spec: glib::ffi::gpointer,
1379            f: glib::ffi::gpointer,
1380        ) {
1381            unsafe {
1382                let f: &F = &*(f as *const F);
1383                f(&from_glib_borrow(this))
1384            }
1385        }
1386        unsafe {
1387            let f: Box_<F> = Box_::new(f);
1388            connect_raw(
1389                self.as_ptr() as *mut _,
1390                c"notify::expand".as_ptr() as *const _,
1391                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1392                    notify_expand_trampoline::<F> as *const (),
1393                )),
1394                Box_::into_raw(f),
1395            )
1396        }
1397    }
1398
1399    #[doc(alias = "fixed-width")]
1400    pub fn connect_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1401        unsafe extern "C" fn notify_fixed_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1402            this: *mut ffi::GtkTreeViewColumn,
1403            _param_spec: glib::ffi::gpointer,
1404            f: glib::ffi::gpointer,
1405        ) {
1406            unsafe {
1407                let f: &F = &*(f as *const F);
1408                f(&from_glib_borrow(this))
1409            }
1410        }
1411        unsafe {
1412            let f: Box_<F> = Box_::new(f);
1413            connect_raw(
1414                self.as_ptr() as *mut _,
1415                c"notify::fixed-width".as_ptr() as *const _,
1416                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1417                    notify_fixed_width_trampoline::<F> as *const (),
1418                )),
1419                Box_::into_raw(f),
1420            )
1421        }
1422    }
1423
1424    #[doc(alias = "max-width")]
1425    pub fn connect_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1426        unsafe extern "C" fn notify_max_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1427            this: *mut ffi::GtkTreeViewColumn,
1428            _param_spec: glib::ffi::gpointer,
1429            f: glib::ffi::gpointer,
1430        ) {
1431            unsafe {
1432                let f: &F = &*(f as *const F);
1433                f(&from_glib_borrow(this))
1434            }
1435        }
1436        unsafe {
1437            let f: Box_<F> = Box_::new(f);
1438            connect_raw(
1439                self.as_ptr() as *mut _,
1440                c"notify::max-width".as_ptr() as *const _,
1441                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1442                    notify_max_width_trampoline::<F> as *const (),
1443                )),
1444                Box_::into_raw(f),
1445            )
1446        }
1447    }
1448
1449    #[doc(alias = "min-width")]
1450    pub fn connect_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1451        unsafe extern "C" fn notify_min_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1452            this: *mut ffi::GtkTreeViewColumn,
1453            _param_spec: glib::ffi::gpointer,
1454            f: glib::ffi::gpointer,
1455        ) {
1456            unsafe {
1457                let f: &F = &*(f as *const F);
1458                f(&from_glib_borrow(this))
1459            }
1460        }
1461        unsafe {
1462            let f: Box_<F> = Box_::new(f);
1463            connect_raw(
1464                self.as_ptr() as *mut _,
1465                c"notify::min-width".as_ptr() as *const _,
1466                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1467                    notify_min_width_trampoline::<F> as *const (),
1468                )),
1469                Box_::into_raw(f),
1470            )
1471        }
1472    }
1473
1474    #[doc(alias = "reorderable")]
1475    pub fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1476        unsafe extern "C" fn notify_reorderable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1477            this: *mut ffi::GtkTreeViewColumn,
1478            _param_spec: glib::ffi::gpointer,
1479            f: glib::ffi::gpointer,
1480        ) {
1481            unsafe {
1482                let f: &F = &*(f as *const F);
1483                f(&from_glib_borrow(this))
1484            }
1485        }
1486        unsafe {
1487            let f: Box_<F> = Box_::new(f);
1488            connect_raw(
1489                self.as_ptr() as *mut _,
1490                c"notify::reorderable".as_ptr() as *const _,
1491                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1492                    notify_reorderable_trampoline::<F> as *const (),
1493                )),
1494                Box_::into_raw(f),
1495            )
1496        }
1497    }
1498
1499    #[doc(alias = "resizable")]
1500    pub fn connect_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1501        unsafe extern "C" fn notify_resizable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1502            this: *mut ffi::GtkTreeViewColumn,
1503            _param_spec: glib::ffi::gpointer,
1504            f: glib::ffi::gpointer,
1505        ) {
1506            unsafe {
1507                let f: &F = &*(f as *const F);
1508                f(&from_glib_borrow(this))
1509            }
1510        }
1511        unsafe {
1512            let f: Box_<F> = Box_::new(f);
1513            connect_raw(
1514                self.as_ptr() as *mut _,
1515                c"notify::resizable".as_ptr() as *const _,
1516                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1517                    notify_resizable_trampoline::<F> as *const (),
1518                )),
1519                Box_::into_raw(f),
1520            )
1521        }
1522    }
1523
1524    #[doc(alias = "sizing")]
1525    pub fn connect_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1526        unsafe extern "C" fn notify_sizing_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1527            this: *mut ffi::GtkTreeViewColumn,
1528            _param_spec: glib::ffi::gpointer,
1529            f: glib::ffi::gpointer,
1530        ) {
1531            unsafe {
1532                let f: &F = &*(f as *const F);
1533                f(&from_glib_borrow(this))
1534            }
1535        }
1536        unsafe {
1537            let f: Box_<F> = Box_::new(f);
1538            connect_raw(
1539                self.as_ptr() as *mut _,
1540                c"notify::sizing".as_ptr() as *const _,
1541                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1542                    notify_sizing_trampoline::<F> as *const (),
1543                )),
1544                Box_::into_raw(f),
1545            )
1546        }
1547    }
1548
1549    #[doc(alias = "sort-column-id")]
1550    pub fn connect_sort_column_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1551        unsafe extern "C" fn notify_sort_column_id_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1552            this: *mut ffi::GtkTreeViewColumn,
1553            _param_spec: glib::ffi::gpointer,
1554            f: glib::ffi::gpointer,
1555        ) {
1556            unsafe {
1557                let f: &F = &*(f as *const F);
1558                f(&from_glib_borrow(this))
1559            }
1560        }
1561        unsafe {
1562            let f: Box_<F> = Box_::new(f);
1563            connect_raw(
1564                self.as_ptr() as *mut _,
1565                c"notify::sort-column-id".as_ptr() as *const _,
1566                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1567                    notify_sort_column_id_trampoline::<F> as *const (),
1568                )),
1569                Box_::into_raw(f),
1570            )
1571        }
1572    }
1573
1574    #[doc(alias = "sort-indicator")]
1575    pub fn connect_sort_indicator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1576        unsafe extern "C" fn notify_sort_indicator_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1577            this: *mut ffi::GtkTreeViewColumn,
1578            _param_spec: glib::ffi::gpointer,
1579            f: glib::ffi::gpointer,
1580        ) {
1581            unsafe {
1582                let f: &F = &*(f as *const F);
1583                f(&from_glib_borrow(this))
1584            }
1585        }
1586        unsafe {
1587            let f: Box_<F> = Box_::new(f);
1588            connect_raw(
1589                self.as_ptr() as *mut _,
1590                c"notify::sort-indicator".as_ptr() as *const _,
1591                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1592                    notify_sort_indicator_trampoline::<F> as *const (),
1593                )),
1594                Box_::into_raw(f),
1595            )
1596        }
1597    }
1598
1599    #[doc(alias = "sort-order")]
1600    pub fn connect_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1601        unsafe extern "C" fn notify_sort_order_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1602            this: *mut ffi::GtkTreeViewColumn,
1603            _param_spec: glib::ffi::gpointer,
1604            f: glib::ffi::gpointer,
1605        ) {
1606            unsafe {
1607                let f: &F = &*(f as *const F);
1608                f(&from_glib_borrow(this))
1609            }
1610        }
1611        unsafe {
1612            let f: Box_<F> = Box_::new(f);
1613            connect_raw(
1614                self.as_ptr() as *mut _,
1615                c"notify::sort-order".as_ptr() as *const _,
1616                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1617                    notify_sort_order_trampoline::<F> as *const (),
1618                )),
1619                Box_::into_raw(f),
1620            )
1621        }
1622    }
1623
1624    #[doc(alias = "spacing")]
1625    pub fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1626        unsafe extern "C" fn notify_spacing_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1627            this: *mut ffi::GtkTreeViewColumn,
1628            _param_spec: glib::ffi::gpointer,
1629            f: glib::ffi::gpointer,
1630        ) {
1631            unsafe {
1632                let f: &F = &*(f as *const F);
1633                f(&from_glib_borrow(this))
1634            }
1635        }
1636        unsafe {
1637            let f: Box_<F> = Box_::new(f);
1638            connect_raw(
1639                self.as_ptr() as *mut _,
1640                c"notify::spacing".as_ptr() as *const _,
1641                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1642                    notify_spacing_trampoline::<F> as *const (),
1643                )),
1644                Box_::into_raw(f),
1645            )
1646        }
1647    }
1648
1649    #[doc(alias = "title")]
1650    pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1651        unsafe extern "C" fn notify_title_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1652            this: *mut ffi::GtkTreeViewColumn,
1653            _param_spec: glib::ffi::gpointer,
1654            f: glib::ffi::gpointer,
1655        ) {
1656            unsafe {
1657                let f: &F = &*(f as *const F);
1658                f(&from_glib_borrow(this))
1659            }
1660        }
1661        unsafe {
1662            let f: Box_<F> = Box_::new(f);
1663            connect_raw(
1664                self.as_ptr() as *mut _,
1665                c"notify::title".as_ptr() as *const _,
1666                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1667                    notify_title_trampoline::<F> as *const (),
1668                )),
1669                Box_::into_raw(f),
1670            )
1671        }
1672    }
1673
1674    #[doc(alias = "visible")]
1675    pub fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1676        unsafe extern "C" fn notify_visible_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1677            this: *mut ffi::GtkTreeViewColumn,
1678            _param_spec: glib::ffi::gpointer,
1679            f: glib::ffi::gpointer,
1680        ) {
1681            unsafe {
1682                let f: &F = &*(f as *const F);
1683                f(&from_glib_borrow(this))
1684            }
1685        }
1686        unsafe {
1687            let f: Box_<F> = Box_::new(f);
1688            connect_raw(
1689                self.as_ptr() as *mut _,
1690                c"notify::visible".as_ptr() as *const _,
1691                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1692                    notify_visible_trampoline::<F> as *const (),
1693                )),
1694                Box_::into_raw(f),
1695            )
1696        }
1697    }
1698
1699    #[doc(alias = "widget")]
1700    pub fn connect_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1701        unsafe extern "C" fn notify_widget_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1702            this: *mut ffi::GtkTreeViewColumn,
1703            _param_spec: glib::ffi::gpointer,
1704            f: glib::ffi::gpointer,
1705        ) {
1706            unsafe {
1707                let f: &F = &*(f as *const F);
1708                f(&from_glib_borrow(this))
1709            }
1710        }
1711        unsafe {
1712            let f: Box_<F> = Box_::new(f);
1713            connect_raw(
1714                self.as_ptr() as *mut _,
1715                c"notify::widget".as_ptr() as *const _,
1716                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1717                    notify_widget_trampoline::<F> as *const (),
1718                )),
1719                Box_::into_raw(f),
1720            )
1721        }
1722    }
1723
1724    #[doc(alias = "width")]
1725    pub fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1726        unsafe extern "C" fn notify_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1727            this: *mut ffi::GtkTreeViewColumn,
1728            _param_spec: glib::ffi::gpointer,
1729            f: glib::ffi::gpointer,
1730        ) {
1731            unsafe {
1732                let f: &F = &*(f as *const F);
1733                f(&from_glib_borrow(this))
1734            }
1735        }
1736        unsafe {
1737            let f: Box_<F> = Box_::new(f);
1738            connect_raw(
1739                self.as_ptr() as *mut _,
1740                c"notify::width".as_ptr() as *const _,
1741                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1742                    notify_width_trampoline::<F> as *const (),
1743                )),
1744                Box_::into_raw(f),
1745            )
1746        }
1747    }
1748
1749    #[doc(alias = "x-offset")]
1750    pub fn connect_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1751        unsafe extern "C" fn notify_x_offset_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1752            this: *mut ffi::GtkTreeViewColumn,
1753            _param_spec: glib::ffi::gpointer,
1754            f: glib::ffi::gpointer,
1755        ) {
1756            unsafe {
1757                let f: &F = &*(f as *const F);
1758                f(&from_glib_borrow(this))
1759            }
1760        }
1761        unsafe {
1762            let f: Box_<F> = Box_::new(f);
1763            connect_raw(
1764                self.as_ptr() as *mut _,
1765                c"notify::x-offset".as_ptr() as *const _,
1766                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1767                    notify_x_offset_trampoline::<F> as *const (),
1768                )),
1769                Box_::into_raw(f),
1770            )
1771        }
1772    }
1773}
1774
1775impl Default for TreeViewColumn {
1776    fn default() -> Self {
1777        Self::new()
1778    }
1779}
1780
1781// rustdoc-stripper-ignore-next
1782/// A [builder-pattern] type to construct [`TreeViewColumn`] objects.
1783///
1784/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1785#[must_use = "The builder must be built to be used"]
1786pub struct TreeViewColumnBuilder {
1787    builder: glib::object::ObjectBuilder<'static, TreeViewColumn>,
1788}
1789
1790impl TreeViewColumnBuilder {
1791    fn new() -> Self {
1792        Self {
1793            builder: glib::object::Object::builder(),
1794        }
1795    }
1796
1797    pub fn alignment(self, alignment: f32) -> Self {
1798        Self {
1799            builder: self.builder.property("alignment", alignment),
1800        }
1801    }
1802
1803    /// The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
1804    ///
1805    /// If no area is specified when creating the tree view column with gtk_tree_view_column_new_with_area()
1806    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
1807    pub fn cell_area(self, cell_area: &impl IsA<CellArea>) -> Self {
1808        Self {
1809            builder: self
1810                .builder
1811                .property("cell-area", cell_area.clone().upcast()),
1812        }
1813    }
1814
1815    pub fn clickable(self, clickable: bool) -> Self {
1816        Self {
1817            builder: self.builder.property("clickable", clickable),
1818        }
1819    }
1820
1821    pub fn expand(self, expand: bool) -> Self {
1822        Self {
1823            builder: self.builder.property("expand", expand),
1824        }
1825    }
1826
1827    pub fn fixed_width(self, fixed_width: i32) -> Self {
1828        Self {
1829            builder: self.builder.property("fixed-width", fixed_width),
1830        }
1831    }
1832
1833    pub fn max_width(self, max_width: i32) -> Self {
1834        Self {
1835            builder: self.builder.property("max-width", max_width),
1836        }
1837    }
1838
1839    pub fn min_width(self, min_width: i32) -> Self {
1840        Self {
1841            builder: self.builder.property("min-width", min_width),
1842        }
1843    }
1844
1845    pub fn reorderable(self, reorderable: bool) -> Self {
1846        Self {
1847            builder: self.builder.property("reorderable", reorderable),
1848        }
1849    }
1850
1851    pub fn resizable(self, resizable: bool) -> Self {
1852        Self {
1853            builder: self.builder.property("resizable", resizable),
1854        }
1855    }
1856
1857    pub fn sizing(self, sizing: TreeViewColumnSizing) -> Self {
1858        Self {
1859            builder: self.builder.property("sizing", sizing),
1860        }
1861    }
1862
1863    /// Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
1864    /// clickable. Set to -1 to make the column unsortable.
1865    pub fn sort_column_id(self, sort_column_id: i32) -> Self {
1866        Self {
1867            builder: self.builder.property("sort-column-id", sort_column_id),
1868        }
1869    }
1870
1871    pub fn sort_indicator(self, sort_indicator: bool) -> Self {
1872        Self {
1873            builder: self.builder.property("sort-indicator", sort_indicator),
1874        }
1875    }
1876
1877    pub fn sort_order(self, sort_order: SortType) -> Self {
1878        Self {
1879            builder: self.builder.property("sort-order", sort_order),
1880        }
1881    }
1882
1883    pub fn spacing(self, spacing: i32) -> Self {
1884        Self {
1885            builder: self.builder.property("spacing", spacing),
1886        }
1887    }
1888
1889    pub fn title(self, title: impl Into<glib::GString>) -> Self {
1890        Self {
1891            builder: self.builder.property("title", title.into()),
1892        }
1893    }
1894
1895    pub fn visible(self, visible: bool) -> Self {
1896        Self {
1897            builder: self.builder.property("visible", visible),
1898        }
1899    }
1900
1901    pub fn widget(self, widget: &impl IsA<Widget>) -> Self {
1902        Self {
1903            builder: self.builder.property("widget", widget.clone().upcast()),
1904        }
1905    }
1906
1907    // rustdoc-stripper-ignore-next
1908    /// Build the [`TreeViewColumn`].
1909    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1910    pub fn build(self) -> TreeViewColumn {
1911        assert_initialized_main_thread!();
1912        self.builder.build()
1913    }
1914}