1#![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 #[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 #[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 #[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 pub fn builder() -> TreeViewColumnBuilder {
184 TreeViewColumnBuilder::new()
185 }
186
187 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
200 #[allow(deprecated)]
201 #[doc(alias = "gtk_tree_view_column_add_attribute")]
202 pub fn add_attribute(
203 &self,
204 cell_renderer: &impl IsA<CellRenderer>,
205 attribute: &str,
206 column: i32,
207 ) {
208 unsafe {
209 ffi::gtk_tree_view_column_add_attribute(
210 self.to_glib_none().0,
211 cell_renderer.as_ref().to_glib_none().0,
212 attribute.to_glib_none().0,
213 column,
214 );
215 }
216 }
217
218 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
240 #[allow(deprecated)]
241 #[doc(alias = "gtk_tree_view_column_cell_get_position")]
242 pub fn cell_get_position(&self, cell_renderer: &impl IsA<CellRenderer>) -> Option<(i32, i32)> {
243 unsafe {
244 let mut x_offset = std::mem::MaybeUninit::uninit();
245 let mut width = std::mem::MaybeUninit::uninit();
246 let ret = from_glib(ffi::gtk_tree_view_column_cell_get_position(
247 self.to_glib_none().0,
248 cell_renderer.as_ref().to_glib_none().0,
249 x_offset.as_mut_ptr(),
250 width.as_mut_ptr(),
251 ));
252 if ret {
253 Some((x_offset.assume_init(), width.assume_init()))
254 } else {
255 None
256 }
257 }
258 }
259
260 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
282 #[allow(deprecated)]
283 #[doc(alias = "gtk_tree_view_column_cell_get_size")]
284 pub fn cell_get_size(&self) -> (i32, i32, i32, i32) {
285 unsafe {
286 let mut x_offset = std::mem::MaybeUninit::uninit();
287 let mut y_offset = std::mem::MaybeUninit::uninit();
288 let mut width = std::mem::MaybeUninit::uninit();
289 let mut height = std::mem::MaybeUninit::uninit();
290 ffi::gtk_tree_view_column_cell_get_size(
291 self.to_glib_none().0,
292 x_offset.as_mut_ptr(),
293 y_offset.as_mut_ptr(),
294 width.as_mut_ptr(),
295 height.as_mut_ptr(),
296 );
297 (
298 x_offset.assume_init(),
299 y_offset.assume_init(),
300 width.assume_init(),
301 height.assume_init(),
302 )
303 }
304 }
305
306 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
318 #[allow(deprecated)]
319 #[doc(alias = "gtk_tree_view_column_cell_is_visible")]
320 pub fn cell_is_visible(&self) -> bool {
321 unsafe {
322 from_glib(ffi::gtk_tree_view_column_cell_is_visible(
323 self.to_glib_none().0,
324 ))
325 }
326 }
327
328 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
345 #[allow(deprecated)]
346 #[doc(alias = "gtk_tree_view_column_cell_set_cell_data")]
347 pub fn cell_set_cell_data(
348 &self,
349 tree_model: &impl IsA<TreeModel>,
350 iter: &TreeIter,
351 is_expander: bool,
352 is_expanded: bool,
353 ) {
354 unsafe {
355 ffi::gtk_tree_view_column_cell_set_cell_data(
356 self.to_glib_none().0,
357 tree_model.as_ref().to_glib_none().0,
358 mut_override(iter.to_glib_none().0),
359 is_expander.into_glib(),
360 is_expanded.into_glib(),
361 );
362 }
363 }
364
365 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
371 #[allow(deprecated)]
372 #[doc(alias = "gtk_tree_view_column_clear")]
373 pub fn clear(&self) {
374 unsafe {
375 ffi::gtk_tree_view_column_clear(self.to_glib_none().0);
376 }
377 }
378
379 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
388 #[allow(deprecated)]
389 #[doc(alias = "gtk_tree_view_column_clear_attributes")]
390 pub fn clear_attributes(&self, cell_renderer: &impl IsA<CellRenderer>) {
391 unsafe {
392 ffi::gtk_tree_view_column_clear_attributes(
393 self.to_glib_none().0,
394 cell_renderer.as_ref().to_glib_none().0,
395 );
396 }
397 }
398
399 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
406 #[allow(deprecated)]
407 #[doc(alias = "gtk_tree_view_column_clicked")]
408 pub fn clicked(&self) {
409 unsafe {
410 ffi::gtk_tree_view_column_clicked(self.to_glib_none().0);
411 }
412 }
413
414 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
423 #[allow(deprecated)]
424 #[doc(alias = "gtk_tree_view_column_focus_cell")]
425 pub fn focus_cell(&self, cell: &impl IsA<CellRenderer>) {
426 unsafe {
427 ffi::gtk_tree_view_column_focus_cell(
428 self.to_glib_none().0,
429 cell.as_ref().to_glib_none().0,
430 );
431 }
432 }
433
434 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
445 #[allow(deprecated)]
446 #[doc(alias = "gtk_tree_view_column_get_alignment")]
447 #[doc(alias = "get_alignment")]
448 pub fn alignment(&self) -> f32 {
449 unsafe { ffi::gtk_tree_view_column_get_alignment(self.to_glib_none().0) }
450 }
451
452 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
462 #[allow(deprecated)]
463 #[doc(alias = "gtk_tree_view_column_get_button")]
464 #[doc(alias = "get_button")]
465 pub fn button(&self) -> Widget {
466 unsafe { from_glib_none(ffi::gtk_tree_view_column_get_button(self.to_glib_none().0)) }
467 }
468
469 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
479 #[allow(deprecated)]
480 #[doc(alias = "gtk_tree_view_column_get_clickable")]
481 #[doc(alias = "get_clickable")]
482 #[doc(alias = "clickable")]
483 pub fn is_clickable(&self) -> bool {
484 unsafe {
485 from_glib(ffi::gtk_tree_view_column_get_clickable(
486 self.to_glib_none().0,
487 ))
488 }
489 }
490
491 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
501 #[allow(deprecated)]
502 #[doc(alias = "gtk_tree_view_column_get_expand")]
503 #[doc(alias = "get_expand")]
504 #[doc(alias = "expand")]
505 pub fn expands(&self) -> bool {
506 unsafe { from_glib(ffi::gtk_tree_view_column_get_expand(self.to_glib_none().0)) }
507 }
508
509 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
520 #[allow(deprecated)]
521 #[doc(alias = "gtk_tree_view_column_get_fixed_width")]
522 #[doc(alias = "get_fixed_width")]
523 #[doc(alias = "fixed-width")]
524 pub fn fixed_width(&self) -> i32 {
525 unsafe { ffi::gtk_tree_view_column_get_fixed_width(self.to_glib_none().0) }
526 }
527
528 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
539 #[allow(deprecated)]
540 #[doc(alias = "gtk_tree_view_column_get_max_width")]
541 #[doc(alias = "get_max_width")]
542 #[doc(alias = "max-width")]
543 pub fn max_width(&self) -> i32 {
544 unsafe { ffi::gtk_tree_view_column_get_max_width(self.to_glib_none().0) }
545 }
546
547 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
558 #[allow(deprecated)]
559 #[doc(alias = "gtk_tree_view_column_get_min_width")]
560 #[doc(alias = "get_min_width")]
561 #[doc(alias = "min-width")]
562 pub fn min_width(&self) -> i32 {
563 unsafe { ffi::gtk_tree_view_column_get_min_width(self.to_glib_none().0) }
564 }
565
566 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
576 #[allow(deprecated)]
577 #[doc(alias = "gtk_tree_view_column_get_reorderable")]
578 #[doc(alias = "get_reorderable")]
579 #[doc(alias = "reorderable")]
580 pub fn is_reorderable(&self) -> bool {
581 unsafe {
582 from_glib(ffi::gtk_tree_view_column_get_reorderable(
583 self.to_glib_none().0,
584 ))
585 }
586 }
587
588 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
598 #[allow(deprecated)]
599 #[doc(alias = "gtk_tree_view_column_get_resizable")]
600 #[doc(alias = "get_resizable")]
601 #[doc(alias = "resizable")]
602 pub fn is_resizable(&self) -> bool {
603 unsafe {
604 from_glib(ffi::gtk_tree_view_column_get_resizable(
605 self.to_glib_none().0,
606 ))
607 }
608 }
609
610 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
620 #[allow(deprecated)]
621 #[doc(alias = "gtk_tree_view_column_get_sizing")]
622 #[doc(alias = "get_sizing")]
623 pub fn sizing(&self) -> TreeViewColumnSizing {
624 unsafe { from_glib(ffi::gtk_tree_view_column_get_sizing(self.to_glib_none().0)) }
625 }
626
627 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
640 #[allow(deprecated)]
641 #[doc(alias = "gtk_tree_view_column_get_sort_column_id")]
642 #[doc(alias = "get_sort_column_id")]
643 #[doc(alias = "sort-column-id")]
644 pub fn sort_column_id(&self) -> i32 {
645 unsafe { ffi::gtk_tree_view_column_get_sort_column_id(self.to_glib_none().0) }
646 }
647
648 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
658 #[allow(deprecated)]
659 #[doc(alias = "gtk_tree_view_column_get_sort_indicator")]
660 #[doc(alias = "get_sort_indicator")]
661 #[doc(alias = "sort-indicator")]
662 pub fn is_sort_indicator(&self) -> bool {
663 unsafe {
664 from_glib(ffi::gtk_tree_view_column_get_sort_indicator(
665 self.to_glib_none().0,
666 ))
667 }
668 }
669
670 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
680 #[allow(deprecated)]
681 #[doc(alias = "gtk_tree_view_column_get_sort_order")]
682 #[doc(alias = "get_sort_order")]
683 #[doc(alias = "sort-order")]
684 pub fn sort_order(&self) -> SortType {
685 unsafe {
686 from_glib(ffi::gtk_tree_view_column_get_sort_order(
687 self.to_glib_none().0,
688 ))
689 }
690 }
691
692 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
702 #[allow(deprecated)]
703 #[doc(alias = "gtk_tree_view_column_get_spacing")]
704 #[doc(alias = "get_spacing")]
705 pub fn spacing(&self) -> i32 {
706 unsafe { ffi::gtk_tree_view_column_get_spacing(self.to_glib_none().0) }
707 }
708
709 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
720 #[allow(deprecated)]
721 #[doc(alias = "gtk_tree_view_column_get_title")]
722 #[doc(alias = "get_title")]
723 pub fn title(&self) -> glib::GString {
724 unsafe { from_glib_none(ffi::gtk_tree_view_column_get_title(self.to_glib_none().0)) }
725 }
726
727 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
740 #[allow(deprecated)]
741 #[doc(alias = "gtk_tree_view_column_get_tree_view")]
742 #[doc(alias = "get_tree_view")]
743 pub fn tree_view(&self) -> Option<Widget> {
744 unsafe {
745 from_glib_none(ffi::gtk_tree_view_column_get_tree_view(
746 self.to_glib_none().0,
747 ))
748 }
749 }
750
751 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
762 #[allow(deprecated)]
763 #[doc(alias = "gtk_tree_view_column_get_visible")]
764 #[doc(alias = "get_visible")]
765 #[doc(alias = "visible")]
766 pub fn is_visible(&self) -> bool {
767 unsafe { from_glib(ffi::gtk_tree_view_column_get_visible(self.to_glib_none().0)) }
768 }
769
770 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
782 #[allow(deprecated)]
783 #[doc(alias = "gtk_tree_view_column_get_widget")]
784 #[doc(alias = "get_widget")]
785 pub fn widget(&self) -> Option<Widget> {
786 unsafe { from_glib_none(ffi::gtk_tree_view_column_get_widget(self.to_glib_none().0)) }
787 }
788
789 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
799 #[allow(deprecated)]
800 #[doc(alias = "gtk_tree_view_column_get_width")]
801 #[doc(alias = "get_width")]
802 pub fn width(&self) -> i32 {
803 unsafe { ffi::gtk_tree_view_column_get_width(self.to_glib_none().0) }
804 }
805
806 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
816 #[allow(deprecated)]
817 #[doc(alias = "gtk_tree_view_column_get_x_offset")]
818 #[doc(alias = "get_x_offset")]
819 #[doc(alias = "x-offset")]
820 pub fn x_offset(&self) -> i32 {
821 unsafe { ffi::gtk_tree_view_column_get_x_offset(self.to_glib_none().0) }
822 }
823
824 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
836 #[allow(deprecated)]
837 #[doc(alias = "gtk_tree_view_column_pack_end")]
838 pub fn pack_end(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
839 unsafe {
840 ffi::gtk_tree_view_column_pack_end(
841 self.to_glib_none().0,
842 cell.as_ref().to_glib_none().0,
843 expand.into_glib(),
844 );
845 }
846 }
847
848 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
860 #[allow(deprecated)]
861 #[doc(alias = "gtk_tree_view_column_pack_start")]
862 pub fn pack_start(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
863 unsafe {
864 ffi::gtk_tree_view_column_pack_start(
865 self.to_glib_none().0,
866 cell.as_ref().to_glib_none().0,
867 expand.into_glib(),
868 );
869 }
870 }
871
872 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
879 #[allow(deprecated)]
880 #[doc(alias = "gtk_tree_view_column_queue_resize")]
881 pub fn queue_resize(&self) {
882 unsafe {
883 ffi::gtk_tree_view_column_queue_resize(self.to_glib_none().0);
884 }
885 }
886
887 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
897 #[allow(deprecated)]
898 #[doc(alias = "gtk_tree_view_column_set_alignment")]
899 #[doc(alias = "alignment")]
900 pub fn set_alignment(&self, xalign: f32) {
901 unsafe {
902 ffi::gtk_tree_view_column_set_alignment(self.to_glib_none().0, xalign);
903 }
904 }
905
906 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
924 #[allow(deprecated)]
925 #[doc(alias = "gtk_tree_view_column_set_cell_data_func")]
926 pub fn set_cell_data_func<
927 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
928 >(
929 &self,
930 cell_renderer: &impl IsA<CellRenderer>,
931 func: P,
932 ) {
933 let func_data: Box_<P> = Box_::new(func);
934 unsafe extern "C" fn func_func<
935 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
936 >(
937 tree_column: *mut ffi::GtkTreeViewColumn,
938 cell: *mut ffi::GtkCellRenderer,
939 tree_model: *mut ffi::GtkTreeModel,
940 iter: *mut ffi::GtkTreeIter,
941 data: glib::ffi::gpointer,
942 ) {
943 unsafe {
944 let tree_column = from_glib_borrow(tree_column);
945 let cell = from_glib_borrow(cell);
946 let tree_model = from_glib_borrow(tree_model);
947 let iter = from_glib_borrow(iter);
948 let callback = &*(data as *mut P);
949 (*callback)(&tree_column, &cell, &tree_model, &iter)
950 }
951 }
952 let func = Some(func_func::<P> as _);
953 unsafe extern "C" fn destroy_func<
954 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
955 >(
956 data: glib::ffi::gpointer,
957 ) {
958 unsafe {
959 let _callback = Box_::from_raw(data as *mut P);
960 }
961 }
962 let destroy_call4 = Some(destroy_func::<P> as _);
963 let super_callback0: Box_<P> = func_data;
964 unsafe {
965 ffi::gtk_tree_view_column_set_cell_data_func(
966 self.to_glib_none().0,
967 cell_renderer.as_ref().to_glib_none().0,
968 func,
969 Box_::into_raw(super_callback0) as *mut _,
970 destroy_call4,
971 );
972 }
973 }
974
975 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
984 #[allow(deprecated)]
985 #[doc(alias = "gtk_tree_view_column_set_clickable")]
986 #[doc(alias = "clickable")]
987 pub fn set_clickable(&self, clickable: bool) {
988 unsafe {
989 ffi::gtk_tree_view_column_set_clickable(self.to_glib_none().0, clickable.into_glib());
990 }
991 }
992
993 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1002 #[allow(deprecated)]
1003 #[doc(alias = "gtk_tree_view_column_set_expand")]
1004 #[doc(alias = "expand")]
1005 pub fn set_expand(&self, expand: bool) {
1006 unsafe {
1007 ffi::gtk_tree_view_column_set_expand(self.to_glib_none().0, expand.into_glib());
1008 }
1009 }
1010
1011 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1020 #[allow(deprecated)]
1021 #[doc(alias = "gtk_tree_view_column_set_fixed_width")]
1022 #[doc(alias = "fixed-width")]
1023 pub fn set_fixed_width(&self, fixed_width: i32) {
1024 unsafe {
1025 ffi::gtk_tree_view_column_set_fixed_width(self.to_glib_none().0, fixed_width);
1026 }
1027 }
1028
1029 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1038 #[allow(deprecated)]
1039 #[doc(alias = "gtk_tree_view_column_set_max_width")]
1040 #[doc(alias = "max-width")]
1041 pub fn set_max_width(&self, max_width: i32) {
1042 unsafe {
1043 ffi::gtk_tree_view_column_set_max_width(self.to_glib_none().0, max_width);
1044 }
1045 }
1046
1047 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1056 #[allow(deprecated)]
1057 #[doc(alias = "gtk_tree_view_column_set_min_width")]
1058 #[doc(alias = "min-width")]
1059 pub fn set_min_width(&self, min_width: i32) {
1060 unsafe {
1061 ffi::gtk_tree_view_column_set_min_width(self.to_glib_none().0, min_width);
1062 }
1063 }
1064
1065 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1074 #[allow(deprecated)]
1075 #[doc(alias = "gtk_tree_view_column_set_reorderable")]
1076 #[doc(alias = "reorderable")]
1077 pub fn set_reorderable(&self, reorderable: bool) {
1078 unsafe {
1079 ffi::gtk_tree_view_column_set_reorderable(
1080 self.to_glib_none().0,
1081 reorderable.into_glib(),
1082 );
1083 }
1084 }
1085
1086 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1099 #[allow(deprecated)]
1100 #[doc(alias = "gtk_tree_view_column_set_resizable")]
1101 #[doc(alias = "resizable")]
1102 pub fn set_resizable(&self, resizable: bool) {
1103 unsafe {
1104 ffi::gtk_tree_view_column_set_resizable(self.to_glib_none().0, resizable.into_glib());
1105 }
1106 }
1107
1108 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1116 #[allow(deprecated)]
1117 #[doc(alias = "gtk_tree_view_column_set_sizing")]
1118 #[doc(alias = "sizing")]
1119 pub fn set_sizing(&self, type_: TreeViewColumnSizing) {
1120 unsafe {
1121 ffi::gtk_tree_view_column_set_sizing(self.to_glib_none().0, type_.into_glib());
1122 }
1123 }
1124
1125 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1134 #[allow(deprecated)]
1135 #[doc(alias = "gtk_tree_view_column_set_sort_column_id")]
1136 #[doc(alias = "sort-column-id")]
1137 pub fn set_sort_column_id(&self, sort_column_id: i32) {
1138 unsafe {
1139 ffi::gtk_tree_view_column_set_sort_column_id(self.to_glib_none().0, sort_column_id);
1140 }
1141 }
1142
1143 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1154 #[allow(deprecated)]
1155 #[doc(alias = "gtk_tree_view_column_set_sort_indicator")]
1156 #[doc(alias = "sort-indicator")]
1157 pub fn set_sort_indicator(&self, setting: bool) {
1158 unsafe {
1159 ffi::gtk_tree_view_column_set_sort_indicator(
1160 self.to_glib_none().0,
1161 setting.into_glib(),
1162 );
1163 }
1164 }
1165
1166 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1184 #[allow(deprecated)]
1185 #[doc(alias = "gtk_tree_view_column_set_sort_order")]
1186 #[doc(alias = "sort-order")]
1187 pub fn set_sort_order(&self, order: SortType) {
1188 unsafe {
1189 ffi::gtk_tree_view_column_set_sort_order(self.to_glib_none().0, order.into_glib());
1190 }
1191 }
1192
1193 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1202 #[allow(deprecated)]
1203 #[doc(alias = "gtk_tree_view_column_set_spacing")]
1204 #[doc(alias = "spacing")]
1205 pub fn set_spacing(&self, spacing: i32) {
1206 unsafe {
1207 ffi::gtk_tree_view_column_set_spacing(self.to_glib_none().0, spacing);
1208 }
1209 }
1210
1211 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1220 #[allow(deprecated)]
1221 #[doc(alias = "gtk_tree_view_column_set_title")]
1222 #[doc(alias = "title")]
1223 pub fn set_title(&self, title: &str) {
1224 unsafe {
1225 ffi::gtk_tree_view_column_set_title(self.to_glib_none().0, title.to_glib_none().0);
1226 }
1227 }
1228
1229 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1237 #[allow(deprecated)]
1238 #[doc(alias = "gtk_tree_view_column_set_visible")]
1239 #[doc(alias = "visible")]
1240 pub fn set_visible(&self, visible: bool) {
1241 unsafe {
1242 ffi::gtk_tree_view_column_set_visible(self.to_glib_none().0, visible.into_glib());
1243 }
1244 }
1245
1246 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1255 #[allow(deprecated)]
1256 #[doc(alias = "gtk_tree_view_column_set_widget")]
1257 #[doc(alias = "widget")]
1258 pub fn set_widget(&self, widget: Option<&impl IsA<Widget>>) {
1259 unsafe {
1260 ffi::gtk_tree_view_column_set_widget(
1261 self.to_glib_none().0,
1262 widget.map(|p| p.as_ref()).to_glib_none().0,
1263 );
1264 }
1265 }
1266
1267 #[doc(alias = "cell-area")]
1272 pub fn cell_area(&self) -> Option<CellArea> {
1273 ObjectExt::property(self, "cell-area")
1274 }
1275
1276 #[doc(alias = "clicked")]
1278 pub fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1279 unsafe extern "C" fn clicked_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1280 this: *mut ffi::GtkTreeViewColumn,
1281 f: glib::ffi::gpointer,
1282 ) {
1283 unsafe {
1284 let f: &F = &*(f as *const F);
1285 f(&from_glib_borrow(this))
1286 }
1287 }
1288 unsafe {
1289 let f: Box_<F> = Box_::new(f);
1290 connect_raw(
1291 self.as_ptr() as *mut _,
1292 c"clicked".as_ptr(),
1293 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1294 clicked_trampoline::<F> as *const (),
1295 )),
1296 Box_::into_raw(f),
1297 )
1298 }
1299 }
1300
1301 #[doc(alias = "alignment")]
1302 pub fn connect_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1303 unsafe extern "C" fn notify_alignment_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1304 this: *mut ffi::GtkTreeViewColumn,
1305 _param_spec: glib::ffi::gpointer,
1306 f: glib::ffi::gpointer,
1307 ) {
1308 unsafe {
1309 let f: &F = &*(f as *const F);
1310 f(&from_glib_borrow(this))
1311 }
1312 }
1313 unsafe {
1314 let f: Box_<F> = Box_::new(f);
1315 connect_raw(
1316 self.as_ptr() as *mut _,
1317 c"notify::alignment".as_ptr(),
1318 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1319 notify_alignment_trampoline::<F> as *const (),
1320 )),
1321 Box_::into_raw(f),
1322 )
1323 }
1324 }
1325
1326 #[doc(alias = "clickable")]
1327 pub fn connect_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1328 unsafe extern "C" fn notify_clickable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1329 this: *mut ffi::GtkTreeViewColumn,
1330 _param_spec: glib::ffi::gpointer,
1331 f: glib::ffi::gpointer,
1332 ) {
1333 unsafe {
1334 let f: &F = &*(f as *const F);
1335 f(&from_glib_borrow(this))
1336 }
1337 }
1338 unsafe {
1339 let f: Box_<F> = Box_::new(f);
1340 connect_raw(
1341 self.as_ptr() as *mut _,
1342 c"notify::clickable".as_ptr(),
1343 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1344 notify_clickable_trampoline::<F> as *const (),
1345 )),
1346 Box_::into_raw(f),
1347 )
1348 }
1349 }
1350
1351 #[doc(alias = "expand")]
1352 pub fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1353 unsafe extern "C" fn notify_expand_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1354 this: *mut ffi::GtkTreeViewColumn,
1355 _param_spec: glib::ffi::gpointer,
1356 f: glib::ffi::gpointer,
1357 ) {
1358 unsafe {
1359 let f: &F = &*(f as *const F);
1360 f(&from_glib_borrow(this))
1361 }
1362 }
1363 unsafe {
1364 let f: Box_<F> = Box_::new(f);
1365 connect_raw(
1366 self.as_ptr() as *mut _,
1367 c"notify::expand".as_ptr(),
1368 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1369 notify_expand_trampoline::<F> as *const (),
1370 )),
1371 Box_::into_raw(f),
1372 )
1373 }
1374 }
1375
1376 #[doc(alias = "fixed-width")]
1377 pub fn connect_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1378 unsafe extern "C" fn notify_fixed_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1379 this: *mut ffi::GtkTreeViewColumn,
1380 _param_spec: glib::ffi::gpointer,
1381 f: glib::ffi::gpointer,
1382 ) {
1383 unsafe {
1384 let f: &F = &*(f as *const F);
1385 f(&from_glib_borrow(this))
1386 }
1387 }
1388 unsafe {
1389 let f: Box_<F> = Box_::new(f);
1390 connect_raw(
1391 self.as_ptr() as *mut _,
1392 c"notify::fixed-width".as_ptr(),
1393 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1394 notify_fixed_width_trampoline::<F> as *const (),
1395 )),
1396 Box_::into_raw(f),
1397 )
1398 }
1399 }
1400
1401 #[doc(alias = "max-width")]
1402 pub fn connect_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1403 unsafe extern "C" fn notify_max_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1404 this: *mut ffi::GtkTreeViewColumn,
1405 _param_spec: glib::ffi::gpointer,
1406 f: glib::ffi::gpointer,
1407 ) {
1408 unsafe {
1409 let f: &F = &*(f as *const F);
1410 f(&from_glib_borrow(this))
1411 }
1412 }
1413 unsafe {
1414 let f: Box_<F> = Box_::new(f);
1415 connect_raw(
1416 self.as_ptr() as *mut _,
1417 c"notify::max-width".as_ptr(),
1418 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1419 notify_max_width_trampoline::<F> as *const (),
1420 )),
1421 Box_::into_raw(f),
1422 )
1423 }
1424 }
1425
1426 #[doc(alias = "min-width")]
1427 pub fn connect_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1428 unsafe extern "C" fn notify_min_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1429 this: *mut ffi::GtkTreeViewColumn,
1430 _param_spec: glib::ffi::gpointer,
1431 f: glib::ffi::gpointer,
1432 ) {
1433 unsafe {
1434 let f: &F = &*(f as *const F);
1435 f(&from_glib_borrow(this))
1436 }
1437 }
1438 unsafe {
1439 let f: Box_<F> = Box_::new(f);
1440 connect_raw(
1441 self.as_ptr() as *mut _,
1442 c"notify::min-width".as_ptr(),
1443 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1444 notify_min_width_trampoline::<F> as *const (),
1445 )),
1446 Box_::into_raw(f),
1447 )
1448 }
1449 }
1450
1451 #[doc(alias = "reorderable")]
1452 pub fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1453 unsafe extern "C" fn notify_reorderable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1454 this: *mut ffi::GtkTreeViewColumn,
1455 _param_spec: glib::ffi::gpointer,
1456 f: glib::ffi::gpointer,
1457 ) {
1458 unsafe {
1459 let f: &F = &*(f as *const F);
1460 f(&from_glib_borrow(this))
1461 }
1462 }
1463 unsafe {
1464 let f: Box_<F> = Box_::new(f);
1465 connect_raw(
1466 self.as_ptr() as *mut _,
1467 c"notify::reorderable".as_ptr(),
1468 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1469 notify_reorderable_trampoline::<F> as *const (),
1470 )),
1471 Box_::into_raw(f),
1472 )
1473 }
1474 }
1475
1476 #[doc(alias = "resizable")]
1477 pub fn connect_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1478 unsafe extern "C" fn notify_resizable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1479 this: *mut ffi::GtkTreeViewColumn,
1480 _param_spec: glib::ffi::gpointer,
1481 f: glib::ffi::gpointer,
1482 ) {
1483 unsafe {
1484 let f: &F = &*(f as *const F);
1485 f(&from_glib_borrow(this))
1486 }
1487 }
1488 unsafe {
1489 let f: Box_<F> = Box_::new(f);
1490 connect_raw(
1491 self.as_ptr() as *mut _,
1492 c"notify::resizable".as_ptr(),
1493 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1494 notify_resizable_trampoline::<F> as *const (),
1495 )),
1496 Box_::into_raw(f),
1497 )
1498 }
1499 }
1500
1501 #[doc(alias = "sizing")]
1502 pub fn connect_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1503 unsafe extern "C" fn notify_sizing_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1504 this: *mut ffi::GtkTreeViewColumn,
1505 _param_spec: glib::ffi::gpointer,
1506 f: glib::ffi::gpointer,
1507 ) {
1508 unsafe {
1509 let f: &F = &*(f as *const F);
1510 f(&from_glib_borrow(this))
1511 }
1512 }
1513 unsafe {
1514 let f: Box_<F> = Box_::new(f);
1515 connect_raw(
1516 self.as_ptr() as *mut _,
1517 c"notify::sizing".as_ptr(),
1518 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1519 notify_sizing_trampoline::<F> as *const (),
1520 )),
1521 Box_::into_raw(f),
1522 )
1523 }
1524 }
1525
1526 #[doc(alias = "sort-column-id")]
1527 pub fn connect_sort_column_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1528 unsafe extern "C" fn notify_sort_column_id_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1529 this: *mut ffi::GtkTreeViewColumn,
1530 _param_spec: glib::ffi::gpointer,
1531 f: glib::ffi::gpointer,
1532 ) {
1533 unsafe {
1534 let f: &F = &*(f as *const F);
1535 f(&from_glib_borrow(this))
1536 }
1537 }
1538 unsafe {
1539 let f: Box_<F> = Box_::new(f);
1540 connect_raw(
1541 self.as_ptr() as *mut _,
1542 c"notify::sort-column-id".as_ptr(),
1543 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1544 notify_sort_column_id_trampoline::<F> as *const (),
1545 )),
1546 Box_::into_raw(f),
1547 )
1548 }
1549 }
1550
1551 #[doc(alias = "sort-indicator")]
1552 pub fn connect_sort_indicator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1553 unsafe extern "C" fn notify_sort_indicator_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1554 this: *mut ffi::GtkTreeViewColumn,
1555 _param_spec: glib::ffi::gpointer,
1556 f: glib::ffi::gpointer,
1557 ) {
1558 unsafe {
1559 let f: &F = &*(f as *const F);
1560 f(&from_glib_borrow(this))
1561 }
1562 }
1563 unsafe {
1564 let f: Box_<F> = Box_::new(f);
1565 connect_raw(
1566 self.as_ptr() as *mut _,
1567 c"notify::sort-indicator".as_ptr(),
1568 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1569 notify_sort_indicator_trampoline::<F> as *const (),
1570 )),
1571 Box_::into_raw(f),
1572 )
1573 }
1574 }
1575
1576 #[doc(alias = "sort-order")]
1577 pub fn connect_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1578 unsafe extern "C" fn notify_sort_order_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1579 this: *mut ffi::GtkTreeViewColumn,
1580 _param_spec: glib::ffi::gpointer,
1581 f: glib::ffi::gpointer,
1582 ) {
1583 unsafe {
1584 let f: &F = &*(f as *const F);
1585 f(&from_glib_borrow(this))
1586 }
1587 }
1588 unsafe {
1589 let f: Box_<F> = Box_::new(f);
1590 connect_raw(
1591 self.as_ptr() as *mut _,
1592 c"notify::sort-order".as_ptr(),
1593 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1594 notify_sort_order_trampoline::<F> as *const (),
1595 )),
1596 Box_::into_raw(f),
1597 )
1598 }
1599 }
1600
1601 #[doc(alias = "spacing")]
1602 pub fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1603 unsafe extern "C" fn notify_spacing_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1604 this: *mut ffi::GtkTreeViewColumn,
1605 _param_spec: glib::ffi::gpointer,
1606 f: glib::ffi::gpointer,
1607 ) {
1608 unsafe {
1609 let f: &F = &*(f as *const F);
1610 f(&from_glib_borrow(this))
1611 }
1612 }
1613 unsafe {
1614 let f: Box_<F> = Box_::new(f);
1615 connect_raw(
1616 self.as_ptr() as *mut _,
1617 c"notify::spacing".as_ptr(),
1618 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1619 notify_spacing_trampoline::<F> as *const (),
1620 )),
1621 Box_::into_raw(f),
1622 )
1623 }
1624 }
1625
1626 #[doc(alias = "title")]
1627 pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1628 unsafe extern "C" fn notify_title_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1629 this: *mut ffi::GtkTreeViewColumn,
1630 _param_spec: glib::ffi::gpointer,
1631 f: glib::ffi::gpointer,
1632 ) {
1633 unsafe {
1634 let f: &F = &*(f as *const F);
1635 f(&from_glib_borrow(this))
1636 }
1637 }
1638 unsafe {
1639 let f: Box_<F> = Box_::new(f);
1640 connect_raw(
1641 self.as_ptr() as *mut _,
1642 c"notify::title".as_ptr(),
1643 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1644 notify_title_trampoline::<F> as *const (),
1645 )),
1646 Box_::into_raw(f),
1647 )
1648 }
1649 }
1650
1651 #[doc(alias = "visible")]
1652 pub fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1653 unsafe extern "C" fn notify_visible_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1654 this: *mut ffi::GtkTreeViewColumn,
1655 _param_spec: glib::ffi::gpointer,
1656 f: glib::ffi::gpointer,
1657 ) {
1658 unsafe {
1659 let f: &F = &*(f as *const F);
1660 f(&from_glib_borrow(this))
1661 }
1662 }
1663 unsafe {
1664 let f: Box_<F> = Box_::new(f);
1665 connect_raw(
1666 self.as_ptr() as *mut _,
1667 c"notify::visible".as_ptr(),
1668 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1669 notify_visible_trampoline::<F> as *const (),
1670 )),
1671 Box_::into_raw(f),
1672 )
1673 }
1674 }
1675
1676 #[doc(alias = "widget")]
1677 pub fn connect_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1678 unsafe extern "C" fn notify_widget_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1679 this: *mut ffi::GtkTreeViewColumn,
1680 _param_spec: glib::ffi::gpointer,
1681 f: glib::ffi::gpointer,
1682 ) {
1683 unsafe {
1684 let f: &F = &*(f as *const F);
1685 f(&from_glib_borrow(this))
1686 }
1687 }
1688 unsafe {
1689 let f: Box_<F> = Box_::new(f);
1690 connect_raw(
1691 self.as_ptr() as *mut _,
1692 c"notify::widget".as_ptr(),
1693 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1694 notify_widget_trampoline::<F> as *const (),
1695 )),
1696 Box_::into_raw(f),
1697 )
1698 }
1699 }
1700
1701 #[doc(alias = "width")]
1702 pub fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1703 unsafe extern "C" fn notify_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1704 this: *mut ffi::GtkTreeViewColumn,
1705 _param_spec: glib::ffi::gpointer,
1706 f: glib::ffi::gpointer,
1707 ) {
1708 unsafe {
1709 let f: &F = &*(f as *const F);
1710 f(&from_glib_borrow(this))
1711 }
1712 }
1713 unsafe {
1714 let f: Box_<F> = Box_::new(f);
1715 connect_raw(
1716 self.as_ptr() as *mut _,
1717 c"notify::width".as_ptr(),
1718 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1719 notify_width_trampoline::<F> as *const (),
1720 )),
1721 Box_::into_raw(f),
1722 )
1723 }
1724 }
1725
1726 #[doc(alias = "x-offset")]
1727 pub fn connect_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1728 unsafe extern "C" fn notify_x_offset_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1729 this: *mut ffi::GtkTreeViewColumn,
1730 _param_spec: glib::ffi::gpointer,
1731 f: glib::ffi::gpointer,
1732 ) {
1733 unsafe {
1734 let f: &F = &*(f as *const F);
1735 f(&from_glib_borrow(this))
1736 }
1737 }
1738 unsafe {
1739 let f: Box_<F> = Box_::new(f);
1740 connect_raw(
1741 self.as_ptr() as *mut _,
1742 c"notify::x-offset".as_ptr(),
1743 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1744 notify_x_offset_trampoline::<F> as *const (),
1745 )),
1746 Box_::into_raw(f),
1747 )
1748 }
1749 }
1750}
1751
1752impl Default for TreeViewColumn {
1753 fn default() -> Self {
1754 Self::new()
1755 }
1756}
1757
1758#[must_use = "The builder must be built to be used"]
1763pub struct TreeViewColumnBuilder {
1764 builder: glib::object::ObjectBuilder<'static, TreeViewColumn>,
1765}
1766
1767impl TreeViewColumnBuilder {
1768 fn new() -> Self {
1769 Self {
1770 builder: glib::object::Object::builder(),
1771 }
1772 }
1773
1774 pub fn alignment(self, alignment: f32) -> Self {
1775 Self {
1776 builder: self.builder.property("alignment", alignment),
1777 }
1778 }
1779
1780 pub fn cell_area(self, cell_area: &impl IsA<CellArea>) -> Self {
1785 Self {
1786 builder: self
1787 .builder
1788 .property("cell-area", cell_area.clone().upcast()),
1789 }
1790 }
1791
1792 pub fn clickable(self, clickable: bool) -> Self {
1793 Self {
1794 builder: self.builder.property("clickable", clickable),
1795 }
1796 }
1797
1798 pub fn expand(self, expand: bool) -> Self {
1799 Self {
1800 builder: self.builder.property("expand", expand),
1801 }
1802 }
1803
1804 pub fn fixed_width(self, fixed_width: i32) -> Self {
1805 Self {
1806 builder: self.builder.property("fixed-width", fixed_width),
1807 }
1808 }
1809
1810 pub fn max_width(self, max_width: i32) -> Self {
1811 Self {
1812 builder: self.builder.property("max-width", max_width),
1813 }
1814 }
1815
1816 pub fn min_width(self, min_width: i32) -> Self {
1817 Self {
1818 builder: self.builder.property("min-width", min_width),
1819 }
1820 }
1821
1822 pub fn reorderable(self, reorderable: bool) -> Self {
1823 Self {
1824 builder: self.builder.property("reorderable", reorderable),
1825 }
1826 }
1827
1828 pub fn resizable(self, resizable: bool) -> Self {
1829 Self {
1830 builder: self.builder.property("resizable", resizable),
1831 }
1832 }
1833
1834 pub fn sizing(self, sizing: TreeViewColumnSizing) -> Self {
1835 Self {
1836 builder: self.builder.property("sizing", sizing),
1837 }
1838 }
1839
1840 pub fn sort_column_id(self, sort_column_id: i32) -> Self {
1843 Self {
1844 builder: self.builder.property("sort-column-id", sort_column_id),
1845 }
1846 }
1847
1848 pub fn sort_indicator(self, sort_indicator: bool) -> Self {
1849 Self {
1850 builder: self.builder.property("sort-indicator", sort_indicator),
1851 }
1852 }
1853
1854 pub fn sort_order(self, sort_order: SortType) -> Self {
1855 Self {
1856 builder: self.builder.property("sort-order", sort_order),
1857 }
1858 }
1859
1860 pub fn spacing(self, spacing: i32) -> Self {
1861 Self {
1862 builder: self.builder.property("spacing", spacing),
1863 }
1864 }
1865
1866 pub fn title(self, title: impl Into<glib::GString>) -> Self {
1867 Self {
1868 builder: self.builder.property("title", title.into()),
1869 }
1870 }
1871
1872 pub fn visible(self, visible: bool) -> Self {
1873 Self {
1874 builder: self.builder.property("visible", visible),
1875 }
1876 }
1877
1878 pub fn widget(self, widget: &impl IsA<Widget>) -> Self {
1879 Self {
1880 builder: self.builder.property("widget", widget.clone().upcast()),
1881 }
1882 }
1883
1884 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1887 pub fn build(self) -> TreeViewColumn {
1888 assert_initialized_main_thread!();
1889 self.builder.build()
1890 }
1891}