Skip to main content

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