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")]
206 #[allow(deprecated)]
207 #[doc(alias = "gtk_tree_view_column_add_attribute")]
208 pub fn add_attribute(
209 &self,
210 cell_renderer: &impl IsA<CellRenderer>,
211 attribute: &str,
212 column: i32,
213 ) {
214 unsafe {
215 ffi::gtk_tree_view_column_add_attribute(
216 self.to_glib_none().0,
217 cell_renderer.as_ref().to_glib_none().0,
218 attribute.to_glib_none().0,
219 column,
220 );
221 }
222 }
223
224 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
246 #[allow(deprecated)]
247 #[doc(alias = "gtk_tree_view_column_cell_get_position")]
248 pub fn cell_get_position(&self, cell_renderer: &impl IsA<CellRenderer>) -> Option<(i32, i32)> {
249 unsafe {
250 let mut x_offset = std::mem::MaybeUninit::uninit();
251 let mut width = std::mem::MaybeUninit::uninit();
252 let ret = from_glib(ffi::gtk_tree_view_column_cell_get_position(
253 self.to_glib_none().0,
254 cell_renderer.as_ref().to_glib_none().0,
255 x_offset.as_mut_ptr(),
256 width.as_mut_ptr(),
257 ));
258 if ret {
259 Some((x_offset.assume_init(), width.assume_init()))
260 } else {
261 None
262 }
263 }
264 }
265
266 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
288 #[allow(deprecated)]
289 #[doc(alias = "gtk_tree_view_column_cell_get_size")]
290 pub fn cell_get_size(&self) -> (i32, i32, i32, i32) {
291 unsafe {
292 let mut x_offset = std::mem::MaybeUninit::uninit();
293 let mut y_offset = std::mem::MaybeUninit::uninit();
294 let mut width = std::mem::MaybeUninit::uninit();
295 let mut height = std::mem::MaybeUninit::uninit();
296 ffi::gtk_tree_view_column_cell_get_size(
297 self.to_glib_none().0,
298 x_offset.as_mut_ptr(),
299 y_offset.as_mut_ptr(),
300 width.as_mut_ptr(),
301 height.as_mut_ptr(),
302 );
303 (
304 x_offset.assume_init(),
305 y_offset.assume_init(),
306 width.assume_init(),
307 height.assume_init(),
308 )
309 }
310 }
311
312 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
324 #[allow(deprecated)]
325 #[doc(alias = "gtk_tree_view_column_cell_is_visible")]
326 pub fn cell_is_visible(&self) -> bool {
327 unsafe {
328 from_glib(ffi::gtk_tree_view_column_cell_is_visible(
329 self.to_glib_none().0,
330 ))
331 }
332 }
333
334 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
351 #[allow(deprecated)]
352 #[doc(alias = "gtk_tree_view_column_cell_set_cell_data")]
353 pub fn cell_set_cell_data(
354 &self,
355 tree_model: &impl IsA<TreeModel>,
356 iter: &TreeIter,
357 is_expander: bool,
358 is_expanded: bool,
359 ) {
360 unsafe {
361 ffi::gtk_tree_view_column_cell_set_cell_data(
362 self.to_glib_none().0,
363 tree_model.as_ref().to_glib_none().0,
364 mut_override(iter.to_glib_none().0),
365 is_expander.into_glib(),
366 is_expanded.into_glib(),
367 );
368 }
369 }
370
371 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
377 #[allow(deprecated)]
378 #[doc(alias = "gtk_tree_view_column_clear")]
379 pub fn clear(&self) {
380 unsafe {
381 ffi::gtk_tree_view_column_clear(self.to_glib_none().0);
382 }
383 }
384
385 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
394 #[allow(deprecated)]
395 #[doc(alias = "gtk_tree_view_column_clear_attributes")]
396 pub fn clear_attributes(&self, cell_renderer: &impl IsA<CellRenderer>) {
397 unsafe {
398 ffi::gtk_tree_view_column_clear_attributes(
399 self.to_glib_none().0,
400 cell_renderer.as_ref().to_glib_none().0,
401 );
402 }
403 }
404
405 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
412 #[allow(deprecated)]
413 #[doc(alias = "gtk_tree_view_column_clicked")]
414 pub fn clicked(&self) {
415 unsafe {
416 ffi::gtk_tree_view_column_clicked(self.to_glib_none().0);
417 }
418 }
419
420 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
429 #[allow(deprecated)]
430 #[doc(alias = "gtk_tree_view_column_focus_cell")]
431 pub fn focus_cell(&self, cell: &impl IsA<CellRenderer>) {
432 unsafe {
433 ffi::gtk_tree_view_column_focus_cell(
434 self.to_glib_none().0,
435 cell.as_ref().to_glib_none().0,
436 );
437 }
438 }
439
440 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
451 #[allow(deprecated)]
452 #[doc(alias = "gtk_tree_view_column_get_alignment")]
453 #[doc(alias = "get_alignment")]
454 pub fn alignment(&self) -> f32 {
455 unsafe { ffi::gtk_tree_view_column_get_alignment(self.to_glib_none().0) }
456 }
457
458 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
468 #[allow(deprecated)]
469 #[doc(alias = "gtk_tree_view_column_get_button")]
470 #[doc(alias = "get_button")]
471 pub fn button(&self) -> Widget {
472 unsafe { from_glib_none(ffi::gtk_tree_view_column_get_button(self.to_glib_none().0)) }
473 }
474
475 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
485 #[allow(deprecated)]
486 #[doc(alias = "gtk_tree_view_column_get_clickable")]
487 #[doc(alias = "get_clickable")]
488 #[doc(alias = "clickable")]
489 pub fn is_clickable(&self) -> bool {
490 unsafe {
491 from_glib(ffi::gtk_tree_view_column_get_clickable(
492 self.to_glib_none().0,
493 ))
494 }
495 }
496
497 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
507 #[allow(deprecated)]
508 #[doc(alias = "gtk_tree_view_column_get_expand")]
509 #[doc(alias = "get_expand")]
510 #[doc(alias = "expand")]
511 pub fn expands(&self) -> bool {
512 unsafe { from_glib(ffi::gtk_tree_view_column_get_expand(self.to_glib_none().0)) }
513 }
514
515 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
526 #[allow(deprecated)]
527 #[doc(alias = "gtk_tree_view_column_get_fixed_width")]
528 #[doc(alias = "get_fixed_width")]
529 #[doc(alias = "fixed-width")]
530 pub fn fixed_width(&self) -> i32 {
531 unsafe { ffi::gtk_tree_view_column_get_fixed_width(self.to_glib_none().0) }
532 }
533
534 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
545 #[allow(deprecated)]
546 #[doc(alias = "gtk_tree_view_column_get_max_width")]
547 #[doc(alias = "get_max_width")]
548 #[doc(alias = "max-width")]
549 pub fn max_width(&self) -> i32 {
550 unsafe { ffi::gtk_tree_view_column_get_max_width(self.to_glib_none().0) }
551 }
552
553 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
564 #[allow(deprecated)]
565 #[doc(alias = "gtk_tree_view_column_get_min_width")]
566 #[doc(alias = "get_min_width")]
567 #[doc(alias = "min-width")]
568 pub fn min_width(&self) -> i32 {
569 unsafe { ffi::gtk_tree_view_column_get_min_width(self.to_glib_none().0) }
570 }
571
572 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
582 #[allow(deprecated)]
583 #[doc(alias = "gtk_tree_view_column_get_reorderable")]
584 #[doc(alias = "get_reorderable")]
585 #[doc(alias = "reorderable")]
586 pub fn is_reorderable(&self) -> bool {
587 unsafe {
588 from_glib(ffi::gtk_tree_view_column_get_reorderable(
589 self.to_glib_none().0,
590 ))
591 }
592 }
593
594 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
604 #[allow(deprecated)]
605 #[doc(alias = "gtk_tree_view_column_get_resizable")]
606 #[doc(alias = "get_resizable")]
607 #[doc(alias = "resizable")]
608 pub fn is_resizable(&self) -> bool {
609 unsafe {
610 from_glib(ffi::gtk_tree_view_column_get_resizable(
611 self.to_glib_none().0,
612 ))
613 }
614 }
615
616 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
626 #[allow(deprecated)]
627 #[doc(alias = "gtk_tree_view_column_get_sizing")]
628 #[doc(alias = "get_sizing")]
629 pub fn sizing(&self) -> TreeViewColumnSizing {
630 unsafe { from_glib(ffi::gtk_tree_view_column_get_sizing(self.to_glib_none().0)) }
631 }
632
633 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
647 #[allow(deprecated)]
648 #[doc(alias = "gtk_tree_view_column_get_sort_column_id")]
649 #[doc(alias = "get_sort_column_id")]
650 #[doc(alias = "sort-column-id")]
651 pub fn sort_column_id(&self) -> i32 {
652 unsafe { ffi::gtk_tree_view_column_get_sort_column_id(self.to_glib_none().0) }
653 }
654
655 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
665 #[allow(deprecated)]
666 #[doc(alias = "gtk_tree_view_column_get_sort_indicator")]
667 #[doc(alias = "get_sort_indicator")]
668 #[doc(alias = "sort-indicator")]
669 pub fn is_sort_indicator(&self) -> bool {
670 unsafe {
671 from_glib(ffi::gtk_tree_view_column_get_sort_indicator(
672 self.to_glib_none().0,
673 ))
674 }
675 }
676
677 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
687 #[allow(deprecated)]
688 #[doc(alias = "gtk_tree_view_column_get_sort_order")]
689 #[doc(alias = "get_sort_order")]
690 #[doc(alias = "sort-order")]
691 pub fn sort_order(&self) -> SortType {
692 unsafe {
693 from_glib(ffi::gtk_tree_view_column_get_sort_order(
694 self.to_glib_none().0,
695 ))
696 }
697 }
698
699 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
709 #[allow(deprecated)]
710 #[doc(alias = "gtk_tree_view_column_get_spacing")]
711 #[doc(alias = "get_spacing")]
712 pub fn spacing(&self) -> i32 {
713 unsafe { ffi::gtk_tree_view_column_get_spacing(self.to_glib_none().0) }
714 }
715
716 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
727 #[allow(deprecated)]
728 #[doc(alias = "gtk_tree_view_column_get_title")]
729 #[doc(alias = "get_title")]
730 pub fn title(&self) -> glib::GString {
731 unsafe { from_glib_none(ffi::gtk_tree_view_column_get_title(self.to_glib_none().0)) }
732 }
733
734 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
747 #[allow(deprecated)]
748 #[doc(alias = "gtk_tree_view_column_get_tree_view")]
749 #[doc(alias = "get_tree_view")]
750 pub fn tree_view(&self) -> Option<Widget> {
751 unsafe {
752 from_glib_none(ffi::gtk_tree_view_column_get_tree_view(
753 self.to_glib_none().0,
754 ))
755 }
756 }
757
758 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
769 #[allow(deprecated)]
770 #[doc(alias = "gtk_tree_view_column_get_visible")]
771 #[doc(alias = "get_visible")]
772 #[doc(alias = "visible")]
773 pub fn is_visible(&self) -> bool {
774 unsafe { from_glib(ffi::gtk_tree_view_column_get_visible(self.to_glib_none().0)) }
775 }
776
777 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
789 #[allow(deprecated)]
790 #[doc(alias = "gtk_tree_view_column_get_widget")]
791 #[doc(alias = "get_widget")]
792 pub fn widget(&self) -> Option<Widget> {
793 unsafe { from_glib_none(ffi::gtk_tree_view_column_get_widget(self.to_glib_none().0)) }
794 }
795
796 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
806 #[allow(deprecated)]
807 #[doc(alias = "gtk_tree_view_column_get_width")]
808 #[doc(alias = "get_width")]
809 pub fn width(&self) -> i32 {
810 unsafe { ffi::gtk_tree_view_column_get_width(self.to_glib_none().0) }
811 }
812
813 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
823 #[allow(deprecated)]
824 #[doc(alias = "gtk_tree_view_column_get_x_offset")]
825 #[doc(alias = "get_x_offset")]
826 #[doc(alias = "x-offset")]
827 pub fn x_offset(&self) -> i32 {
828 unsafe { ffi::gtk_tree_view_column_get_x_offset(self.to_glib_none().0) }
829 }
830
831 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
843 #[allow(deprecated)]
844 #[doc(alias = "gtk_tree_view_column_pack_end")]
845 pub fn pack_end(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
846 unsafe {
847 ffi::gtk_tree_view_column_pack_end(
848 self.to_glib_none().0,
849 cell.as_ref().to_glib_none().0,
850 expand.into_glib(),
851 );
852 }
853 }
854
855 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
867 #[allow(deprecated)]
868 #[doc(alias = "gtk_tree_view_column_pack_start")]
869 pub fn pack_start(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
870 unsafe {
871 ffi::gtk_tree_view_column_pack_start(
872 self.to_glib_none().0,
873 cell.as_ref().to_glib_none().0,
874 expand.into_glib(),
875 );
876 }
877 }
878
879 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
886 #[allow(deprecated)]
887 #[doc(alias = "gtk_tree_view_column_queue_resize")]
888 pub fn queue_resize(&self) {
889 unsafe {
890 ffi::gtk_tree_view_column_queue_resize(self.to_glib_none().0);
891 }
892 }
893
894 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
904 #[allow(deprecated)]
905 #[doc(alias = "gtk_tree_view_column_set_alignment")]
906 #[doc(alias = "alignment")]
907 pub fn set_alignment(&self, xalign: f32) {
908 unsafe {
909 ffi::gtk_tree_view_column_set_alignment(self.to_glib_none().0, xalign);
910 }
911 }
912
913 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
931 #[allow(deprecated)]
932 #[doc(alias = "gtk_tree_view_column_set_cell_data_func")]
933 pub fn set_cell_data_func<
934 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
935 >(
936 &self,
937 cell_renderer: &impl IsA<CellRenderer>,
938 func: P,
939 ) {
940 let func_data: Box_<P> = Box_::new(func);
941 unsafe extern "C" fn func_func<
942 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
943 >(
944 tree_column: *mut ffi::GtkTreeViewColumn,
945 cell: *mut ffi::GtkCellRenderer,
946 tree_model: *mut ffi::GtkTreeModel,
947 iter: *mut ffi::GtkTreeIter,
948 data: glib::ffi::gpointer,
949 ) {
950 unsafe {
951 let tree_column = from_glib_borrow(tree_column);
952 let cell = from_glib_borrow(cell);
953 let tree_model = from_glib_borrow(tree_model);
954 let iter = from_glib_borrow(iter);
955 let callback = &*(data as *mut P);
956 (*callback)(&tree_column, &cell, &tree_model, &iter)
957 }
958 }
959 let func = Some(func_func::<P> as _);
960 unsafe extern "C" fn destroy_func<
961 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
962 >(
963 data: glib::ffi::gpointer,
964 ) {
965 unsafe {
966 let _callback = Box_::from_raw(data as *mut P);
967 }
968 }
969 let destroy_call4 = Some(destroy_func::<P> as _);
970 let super_callback0: Box_<P> = func_data;
971 unsafe {
972 ffi::gtk_tree_view_column_set_cell_data_func(
973 self.to_glib_none().0,
974 cell_renderer.as_ref().to_glib_none().0,
975 func,
976 Box_::into_raw(super_callback0) as *mut _,
977 destroy_call4,
978 );
979 }
980 }
981
982 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
991 #[allow(deprecated)]
992 #[doc(alias = "gtk_tree_view_column_set_clickable")]
993 #[doc(alias = "clickable")]
994 pub fn set_clickable(&self, clickable: bool) {
995 unsafe {
996 ffi::gtk_tree_view_column_set_clickable(self.to_glib_none().0, clickable.into_glib());
997 }
998 }
999
1000 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1014 #[allow(deprecated)]
1015 #[doc(alias = "gtk_tree_view_column_set_expand")]
1016 #[doc(alias = "expand")]
1017 pub fn set_expand(&self, expand: bool) {
1018 unsafe {
1019 ffi::gtk_tree_view_column_set_expand(self.to_glib_none().0, expand.into_glib());
1020 }
1021 }
1022
1023 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1041 #[allow(deprecated)]
1042 #[doc(alias = "gtk_tree_view_column_set_fixed_width")]
1043 #[doc(alias = "fixed-width")]
1044 pub fn set_fixed_width(&self, fixed_width: i32) {
1045 unsafe {
1046 ffi::gtk_tree_view_column_set_fixed_width(self.to_glib_none().0, fixed_width);
1047 }
1048 }
1049
1050 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1061 #[allow(deprecated)]
1062 #[doc(alias = "gtk_tree_view_column_set_max_width")]
1063 #[doc(alias = "max-width")]
1064 pub fn set_max_width(&self, max_width: i32) {
1065 unsafe {
1066 ffi::gtk_tree_view_column_set_max_width(self.to_glib_none().0, max_width);
1067 }
1068 }
1069
1070 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1079 #[allow(deprecated)]
1080 #[doc(alias = "gtk_tree_view_column_set_min_width")]
1081 #[doc(alias = "min-width")]
1082 pub fn set_min_width(&self, min_width: i32) {
1083 unsafe {
1084 ffi::gtk_tree_view_column_set_min_width(self.to_glib_none().0, min_width);
1085 }
1086 }
1087
1088 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1097 #[allow(deprecated)]
1098 #[doc(alias = "gtk_tree_view_column_set_reorderable")]
1099 #[doc(alias = "reorderable")]
1100 pub fn set_reorderable(&self, reorderable: bool) {
1101 unsafe {
1102 ffi::gtk_tree_view_column_set_reorderable(
1103 self.to_glib_none().0,
1104 reorderable.into_glib(),
1105 );
1106 }
1107 }
1108
1109 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1122 #[allow(deprecated)]
1123 #[doc(alias = "gtk_tree_view_column_set_resizable")]
1124 #[doc(alias = "resizable")]
1125 pub fn set_resizable(&self, resizable: bool) {
1126 unsafe {
1127 ffi::gtk_tree_view_column_set_resizable(self.to_glib_none().0, resizable.into_glib());
1128 }
1129 }
1130
1131 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1139 #[allow(deprecated)]
1140 #[doc(alias = "gtk_tree_view_column_set_sizing")]
1141 #[doc(alias = "sizing")]
1142 pub fn set_sizing(&self, type_: TreeViewColumnSizing) {
1143 unsafe {
1144 ffi::gtk_tree_view_column_set_sizing(self.to_glib_none().0, type_.into_glib());
1145 }
1146 }
1147
1148 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1157 #[allow(deprecated)]
1158 #[doc(alias = "gtk_tree_view_column_set_sort_column_id")]
1159 #[doc(alias = "sort-column-id")]
1160 pub fn set_sort_column_id(&self, sort_column_id: i32) {
1161 unsafe {
1162 ffi::gtk_tree_view_column_set_sort_column_id(self.to_glib_none().0, sort_column_id);
1163 }
1164 }
1165
1166 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1177 #[allow(deprecated)]
1178 #[doc(alias = "gtk_tree_view_column_set_sort_indicator")]
1179 #[doc(alias = "sort-indicator")]
1180 pub fn set_sort_indicator(&self, setting: bool) {
1181 unsafe {
1182 ffi::gtk_tree_view_column_set_sort_indicator(
1183 self.to_glib_none().0,
1184 setting.into_glib(),
1185 );
1186 }
1187 }
1188
1189 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1207 #[allow(deprecated)]
1208 #[doc(alias = "gtk_tree_view_column_set_sort_order")]
1209 #[doc(alias = "sort-order")]
1210 pub fn set_sort_order(&self, order: SortType) {
1211 unsafe {
1212 ffi::gtk_tree_view_column_set_sort_order(self.to_glib_none().0, order.into_glib());
1213 }
1214 }
1215
1216 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1225 #[allow(deprecated)]
1226 #[doc(alias = "gtk_tree_view_column_set_spacing")]
1227 #[doc(alias = "spacing")]
1228 pub fn set_spacing(&self, spacing: i32) {
1229 unsafe {
1230 ffi::gtk_tree_view_column_set_spacing(self.to_glib_none().0, spacing);
1231 }
1232 }
1233
1234 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1243 #[allow(deprecated)]
1244 #[doc(alias = "gtk_tree_view_column_set_title")]
1245 #[doc(alias = "title")]
1246 pub fn set_title(&self, title: &str) {
1247 unsafe {
1248 ffi::gtk_tree_view_column_set_title(self.to_glib_none().0, title.to_glib_none().0);
1249 }
1250 }
1251
1252 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1260 #[allow(deprecated)]
1261 #[doc(alias = "gtk_tree_view_column_set_visible")]
1262 #[doc(alias = "visible")]
1263 pub fn set_visible(&self, visible: bool) {
1264 unsafe {
1265 ffi::gtk_tree_view_column_set_visible(self.to_glib_none().0, visible.into_glib());
1266 }
1267 }
1268
1269 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1278 #[allow(deprecated)]
1279 #[doc(alias = "gtk_tree_view_column_set_widget")]
1280 #[doc(alias = "widget")]
1281 pub fn set_widget(&self, widget: Option<&impl IsA<Widget>>) {
1282 unsafe {
1283 ffi::gtk_tree_view_column_set_widget(
1284 self.to_glib_none().0,
1285 widget.map(|p| p.as_ref()).to_glib_none().0,
1286 );
1287 }
1288 }
1289
1290 #[doc(alias = "cell-area")]
1295 pub fn cell_area(&self) -> Option<CellArea> {
1296 ObjectExt::property(self, "cell-area")
1297 }
1298
1299 #[doc(alias = "clicked")]
1301 pub fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1302 unsafe extern "C" fn clicked_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1303 this: *mut ffi::GtkTreeViewColumn,
1304 f: glib::ffi::gpointer,
1305 ) {
1306 unsafe {
1307 let f: &F = &*(f as *const F);
1308 f(&from_glib_borrow(this))
1309 }
1310 }
1311 unsafe {
1312 let f: Box_<F> = Box_::new(f);
1313 connect_raw(
1314 self.as_ptr() as *mut _,
1315 c"clicked".as_ptr() as *const _,
1316 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1317 clicked_trampoline::<F> as *const (),
1318 )),
1319 Box_::into_raw(f),
1320 )
1321 }
1322 }
1323
1324 #[doc(alias = "alignment")]
1325 pub fn connect_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1326 unsafe extern "C" fn notify_alignment_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1327 this: *mut ffi::GtkTreeViewColumn,
1328 _param_spec: glib::ffi::gpointer,
1329 f: glib::ffi::gpointer,
1330 ) {
1331 unsafe {
1332 let f: &F = &*(f as *const F);
1333 f(&from_glib_borrow(this))
1334 }
1335 }
1336 unsafe {
1337 let f: Box_<F> = Box_::new(f);
1338 connect_raw(
1339 self.as_ptr() as *mut _,
1340 c"notify::alignment".as_ptr() as *const _,
1341 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1342 notify_alignment_trampoline::<F> as *const (),
1343 )),
1344 Box_::into_raw(f),
1345 )
1346 }
1347 }
1348
1349 #[doc(alias = "clickable")]
1350 pub fn connect_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1351 unsafe extern "C" fn notify_clickable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1352 this: *mut ffi::GtkTreeViewColumn,
1353 _param_spec: glib::ffi::gpointer,
1354 f: glib::ffi::gpointer,
1355 ) {
1356 unsafe {
1357 let f: &F = &*(f as *const F);
1358 f(&from_glib_borrow(this))
1359 }
1360 }
1361 unsafe {
1362 let f: Box_<F> = Box_::new(f);
1363 connect_raw(
1364 self.as_ptr() as *mut _,
1365 c"notify::clickable".as_ptr() as *const _,
1366 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1367 notify_clickable_trampoline::<F> as *const (),
1368 )),
1369 Box_::into_raw(f),
1370 )
1371 }
1372 }
1373
1374 #[doc(alias = "expand")]
1375 pub fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1376 unsafe extern "C" fn notify_expand_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1377 this: *mut ffi::GtkTreeViewColumn,
1378 _param_spec: glib::ffi::gpointer,
1379 f: glib::ffi::gpointer,
1380 ) {
1381 unsafe {
1382 let f: &F = &*(f as *const F);
1383 f(&from_glib_borrow(this))
1384 }
1385 }
1386 unsafe {
1387 let f: Box_<F> = Box_::new(f);
1388 connect_raw(
1389 self.as_ptr() as *mut _,
1390 c"notify::expand".as_ptr() as *const _,
1391 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1392 notify_expand_trampoline::<F> as *const (),
1393 )),
1394 Box_::into_raw(f),
1395 )
1396 }
1397 }
1398
1399 #[doc(alias = "fixed-width")]
1400 pub fn connect_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1401 unsafe extern "C" fn notify_fixed_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1402 this: *mut ffi::GtkTreeViewColumn,
1403 _param_spec: glib::ffi::gpointer,
1404 f: glib::ffi::gpointer,
1405 ) {
1406 unsafe {
1407 let f: &F = &*(f as *const F);
1408 f(&from_glib_borrow(this))
1409 }
1410 }
1411 unsafe {
1412 let f: Box_<F> = Box_::new(f);
1413 connect_raw(
1414 self.as_ptr() as *mut _,
1415 c"notify::fixed-width".as_ptr() as *const _,
1416 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1417 notify_fixed_width_trampoline::<F> as *const (),
1418 )),
1419 Box_::into_raw(f),
1420 )
1421 }
1422 }
1423
1424 #[doc(alias = "max-width")]
1425 pub fn connect_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1426 unsafe extern "C" fn notify_max_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1427 this: *mut ffi::GtkTreeViewColumn,
1428 _param_spec: glib::ffi::gpointer,
1429 f: glib::ffi::gpointer,
1430 ) {
1431 unsafe {
1432 let f: &F = &*(f as *const F);
1433 f(&from_glib_borrow(this))
1434 }
1435 }
1436 unsafe {
1437 let f: Box_<F> = Box_::new(f);
1438 connect_raw(
1439 self.as_ptr() as *mut _,
1440 c"notify::max-width".as_ptr() as *const _,
1441 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1442 notify_max_width_trampoline::<F> as *const (),
1443 )),
1444 Box_::into_raw(f),
1445 )
1446 }
1447 }
1448
1449 #[doc(alias = "min-width")]
1450 pub fn connect_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1451 unsafe extern "C" fn notify_min_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1452 this: *mut ffi::GtkTreeViewColumn,
1453 _param_spec: glib::ffi::gpointer,
1454 f: glib::ffi::gpointer,
1455 ) {
1456 unsafe {
1457 let f: &F = &*(f as *const F);
1458 f(&from_glib_borrow(this))
1459 }
1460 }
1461 unsafe {
1462 let f: Box_<F> = Box_::new(f);
1463 connect_raw(
1464 self.as_ptr() as *mut _,
1465 c"notify::min-width".as_ptr() as *const _,
1466 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1467 notify_min_width_trampoline::<F> as *const (),
1468 )),
1469 Box_::into_raw(f),
1470 )
1471 }
1472 }
1473
1474 #[doc(alias = "reorderable")]
1475 pub fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1476 unsafe extern "C" fn notify_reorderable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1477 this: *mut ffi::GtkTreeViewColumn,
1478 _param_spec: glib::ffi::gpointer,
1479 f: glib::ffi::gpointer,
1480 ) {
1481 unsafe {
1482 let f: &F = &*(f as *const F);
1483 f(&from_glib_borrow(this))
1484 }
1485 }
1486 unsafe {
1487 let f: Box_<F> = Box_::new(f);
1488 connect_raw(
1489 self.as_ptr() as *mut _,
1490 c"notify::reorderable".as_ptr() as *const _,
1491 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1492 notify_reorderable_trampoline::<F> as *const (),
1493 )),
1494 Box_::into_raw(f),
1495 )
1496 }
1497 }
1498
1499 #[doc(alias = "resizable")]
1500 pub fn connect_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1501 unsafe extern "C" fn notify_resizable_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1502 this: *mut ffi::GtkTreeViewColumn,
1503 _param_spec: glib::ffi::gpointer,
1504 f: glib::ffi::gpointer,
1505 ) {
1506 unsafe {
1507 let f: &F = &*(f as *const F);
1508 f(&from_glib_borrow(this))
1509 }
1510 }
1511 unsafe {
1512 let f: Box_<F> = Box_::new(f);
1513 connect_raw(
1514 self.as_ptr() as *mut _,
1515 c"notify::resizable".as_ptr() as *const _,
1516 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1517 notify_resizable_trampoline::<F> as *const (),
1518 )),
1519 Box_::into_raw(f),
1520 )
1521 }
1522 }
1523
1524 #[doc(alias = "sizing")]
1525 pub fn connect_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1526 unsafe extern "C" fn notify_sizing_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1527 this: *mut ffi::GtkTreeViewColumn,
1528 _param_spec: glib::ffi::gpointer,
1529 f: glib::ffi::gpointer,
1530 ) {
1531 unsafe {
1532 let f: &F = &*(f as *const F);
1533 f(&from_glib_borrow(this))
1534 }
1535 }
1536 unsafe {
1537 let f: Box_<F> = Box_::new(f);
1538 connect_raw(
1539 self.as_ptr() as *mut _,
1540 c"notify::sizing".as_ptr() as *const _,
1541 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1542 notify_sizing_trampoline::<F> as *const (),
1543 )),
1544 Box_::into_raw(f),
1545 )
1546 }
1547 }
1548
1549 #[doc(alias = "sort-column-id")]
1550 pub fn connect_sort_column_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1551 unsafe extern "C" fn notify_sort_column_id_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1552 this: *mut ffi::GtkTreeViewColumn,
1553 _param_spec: glib::ffi::gpointer,
1554 f: glib::ffi::gpointer,
1555 ) {
1556 unsafe {
1557 let f: &F = &*(f as *const F);
1558 f(&from_glib_borrow(this))
1559 }
1560 }
1561 unsafe {
1562 let f: Box_<F> = Box_::new(f);
1563 connect_raw(
1564 self.as_ptr() as *mut _,
1565 c"notify::sort-column-id".as_ptr() as *const _,
1566 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1567 notify_sort_column_id_trampoline::<F> as *const (),
1568 )),
1569 Box_::into_raw(f),
1570 )
1571 }
1572 }
1573
1574 #[doc(alias = "sort-indicator")]
1575 pub fn connect_sort_indicator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1576 unsafe extern "C" fn notify_sort_indicator_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1577 this: *mut ffi::GtkTreeViewColumn,
1578 _param_spec: glib::ffi::gpointer,
1579 f: glib::ffi::gpointer,
1580 ) {
1581 unsafe {
1582 let f: &F = &*(f as *const F);
1583 f(&from_glib_borrow(this))
1584 }
1585 }
1586 unsafe {
1587 let f: Box_<F> = Box_::new(f);
1588 connect_raw(
1589 self.as_ptr() as *mut _,
1590 c"notify::sort-indicator".as_ptr() as *const _,
1591 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1592 notify_sort_indicator_trampoline::<F> as *const (),
1593 )),
1594 Box_::into_raw(f),
1595 )
1596 }
1597 }
1598
1599 #[doc(alias = "sort-order")]
1600 pub fn connect_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1601 unsafe extern "C" fn notify_sort_order_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1602 this: *mut ffi::GtkTreeViewColumn,
1603 _param_spec: glib::ffi::gpointer,
1604 f: glib::ffi::gpointer,
1605 ) {
1606 unsafe {
1607 let f: &F = &*(f as *const F);
1608 f(&from_glib_borrow(this))
1609 }
1610 }
1611 unsafe {
1612 let f: Box_<F> = Box_::new(f);
1613 connect_raw(
1614 self.as_ptr() as *mut _,
1615 c"notify::sort-order".as_ptr() as *const _,
1616 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1617 notify_sort_order_trampoline::<F> as *const (),
1618 )),
1619 Box_::into_raw(f),
1620 )
1621 }
1622 }
1623
1624 #[doc(alias = "spacing")]
1625 pub fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1626 unsafe extern "C" fn notify_spacing_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1627 this: *mut ffi::GtkTreeViewColumn,
1628 _param_spec: glib::ffi::gpointer,
1629 f: glib::ffi::gpointer,
1630 ) {
1631 unsafe {
1632 let f: &F = &*(f as *const F);
1633 f(&from_glib_borrow(this))
1634 }
1635 }
1636 unsafe {
1637 let f: Box_<F> = Box_::new(f);
1638 connect_raw(
1639 self.as_ptr() as *mut _,
1640 c"notify::spacing".as_ptr() as *const _,
1641 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1642 notify_spacing_trampoline::<F> as *const (),
1643 )),
1644 Box_::into_raw(f),
1645 )
1646 }
1647 }
1648
1649 #[doc(alias = "title")]
1650 pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1651 unsafe extern "C" fn notify_title_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1652 this: *mut ffi::GtkTreeViewColumn,
1653 _param_spec: glib::ffi::gpointer,
1654 f: glib::ffi::gpointer,
1655 ) {
1656 unsafe {
1657 let f: &F = &*(f as *const F);
1658 f(&from_glib_borrow(this))
1659 }
1660 }
1661 unsafe {
1662 let f: Box_<F> = Box_::new(f);
1663 connect_raw(
1664 self.as_ptr() as *mut _,
1665 c"notify::title".as_ptr() as *const _,
1666 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1667 notify_title_trampoline::<F> as *const (),
1668 )),
1669 Box_::into_raw(f),
1670 )
1671 }
1672 }
1673
1674 #[doc(alias = "visible")]
1675 pub fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1676 unsafe extern "C" fn notify_visible_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1677 this: *mut ffi::GtkTreeViewColumn,
1678 _param_spec: glib::ffi::gpointer,
1679 f: glib::ffi::gpointer,
1680 ) {
1681 unsafe {
1682 let f: &F = &*(f as *const F);
1683 f(&from_glib_borrow(this))
1684 }
1685 }
1686 unsafe {
1687 let f: Box_<F> = Box_::new(f);
1688 connect_raw(
1689 self.as_ptr() as *mut _,
1690 c"notify::visible".as_ptr() as *const _,
1691 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1692 notify_visible_trampoline::<F> as *const (),
1693 )),
1694 Box_::into_raw(f),
1695 )
1696 }
1697 }
1698
1699 #[doc(alias = "widget")]
1700 pub fn connect_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1701 unsafe extern "C" fn notify_widget_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1702 this: *mut ffi::GtkTreeViewColumn,
1703 _param_spec: glib::ffi::gpointer,
1704 f: glib::ffi::gpointer,
1705 ) {
1706 unsafe {
1707 let f: &F = &*(f as *const F);
1708 f(&from_glib_borrow(this))
1709 }
1710 }
1711 unsafe {
1712 let f: Box_<F> = Box_::new(f);
1713 connect_raw(
1714 self.as_ptr() as *mut _,
1715 c"notify::widget".as_ptr() as *const _,
1716 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1717 notify_widget_trampoline::<F> as *const (),
1718 )),
1719 Box_::into_raw(f),
1720 )
1721 }
1722 }
1723
1724 #[doc(alias = "width")]
1725 pub fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1726 unsafe extern "C" fn notify_width_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1727 this: *mut ffi::GtkTreeViewColumn,
1728 _param_spec: glib::ffi::gpointer,
1729 f: glib::ffi::gpointer,
1730 ) {
1731 unsafe {
1732 let f: &F = &*(f as *const F);
1733 f(&from_glib_borrow(this))
1734 }
1735 }
1736 unsafe {
1737 let f: Box_<F> = Box_::new(f);
1738 connect_raw(
1739 self.as_ptr() as *mut _,
1740 c"notify::width".as_ptr() as *const _,
1741 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1742 notify_width_trampoline::<F> as *const (),
1743 )),
1744 Box_::into_raw(f),
1745 )
1746 }
1747 }
1748
1749 #[doc(alias = "x-offset")]
1750 pub fn connect_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1751 unsafe extern "C" fn notify_x_offset_trampoline<F: Fn(&TreeViewColumn) + 'static>(
1752 this: *mut ffi::GtkTreeViewColumn,
1753 _param_spec: glib::ffi::gpointer,
1754 f: glib::ffi::gpointer,
1755 ) {
1756 unsafe {
1757 let f: &F = &*(f as *const F);
1758 f(&from_glib_borrow(this))
1759 }
1760 }
1761 unsafe {
1762 let f: Box_<F> = Box_::new(f);
1763 connect_raw(
1764 self.as_ptr() as *mut _,
1765 c"notify::x-offset".as_ptr() as *const _,
1766 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1767 notify_x_offset_trampoline::<F> as *const (),
1768 )),
1769 Box_::into_raw(f),
1770 )
1771 }
1772 }
1773}
1774
1775impl Default for TreeViewColumn {
1776 fn default() -> Self {
1777 Self::new()
1778 }
1779}
1780
1781#[must_use = "The builder must be built to be used"]
1786pub struct TreeViewColumnBuilder {
1787 builder: glib::object::ObjectBuilder<'static, TreeViewColumn>,
1788}
1789
1790impl TreeViewColumnBuilder {
1791 fn new() -> Self {
1792 Self {
1793 builder: glib::object::Object::builder(),
1794 }
1795 }
1796
1797 pub fn alignment(self, alignment: f32) -> Self {
1798 Self {
1799 builder: self.builder.property("alignment", alignment),
1800 }
1801 }
1802
1803 pub fn cell_area(self, cell_area: &impl IsA<CellArea>) -> Self {
1808 Self {
1809 builder: self
1810 .builder
1811 .property("cell-area", cell_area.clone().upcast()),
1812 }
1813 }
1814
1815 pub fn clickable(self, clickable: bool) -> Self {
1816 Self {
1817 builder: self.builder.property("clickable", clickable),
1818 }
1819 }
1820
1821 pub fn expand(self, expand: bool) -> Self {
1822 Self {
1823 builder: self.builder.property("expand", expand),
1824 }
1825 }
1826
1827 pub fn fixed_width(self, fixed_width: i32) -> Self {
1828 Self {
1829 builder: self.builder.property("fixed-width", fixed_width),
1830 }
1831 }
1832
1833 pub fn max_width(self, max_width: i32) -> Self {
1834 Self {
1835 builder: self.builder.property("max-width", max_width),
1836 }
1837 }
1838
1839 pub fn min_width(self, min_width: i32) -> Self {
1840 Self {
1841 builder: self.builder.property("min-width", min_width),
1842 }
1843 }
1844
1845 pub fn reorderable(self, reorderable: bool) -> Self {
1846 Self {
1847 builder: self.builder.property("reorderable", reorderable),
1848 }
1849 }
1850
1851 pub fn resizable(self, resizable: bool) -> Self {
1852 Self {
1853 builder: self.builder.property("resizable", resizable),
1854 }
1855 }
1856
1857 pub fn sizing(self, sizing: TreeViewColumnSizing) -> Self {
1858 Self {
1859 builder: self.builder.property("sizing", sizing),
1860 }
1861 }
1862
1863 pub fn sort_column_id(self, sort_column_id: i32) -> Self {
1866 Self {
1867 builder: self.builder.property("sort-column-id", sort_column_id),
1868 }
1869 }
1870
1871 pub fn sort_indicator(self, sort_indicator: bool) -> Self {
1872 Self {
1873 builder: self.builder.property("sort-indicator", sort_indicator),
1874 }
1875 }
1876
1877 pub fn sort_order(self, sort_order: SortType) -> Self {
1878 Self {
1879 builder: self.builder.property("sort-order", sort_order),
1880 }
1881 }
1882
1883 pub fn spacing(self, spacing: i32) -> Self {
1884 Self {
1885 builder: self.builder.property("spacing", spacing),
1886 }
1887 }
1888
1889 pub fn title(self, title: impl Into<glib::GString>) -> Self {
1890 Self {
1891 builder: self.builder.property("title", title.into()),
1892 }
1893 }
1894
1895 pub fn visible(self, visible: bool) -> Self {
1896 Self {
1897 builder: self.builder.property("visible", visible),
1898 }
1899 }
1900
1901 pub fn widget(self, widget: &impl IsA<Widget>) -> Self {
1902 Self {
1903 builder: self.builder.property("widget", widget.clone().upcast()),
1904 }
1905 }
1906
1907 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1910 pub fn build(self) -> TreeViewColumn {
1911 assert_initialized_main_thread!();
1912 self.builder.build()
1913 }
1914}