gtk4/auto/
window_handle.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    ffi, Accessible, AccessibleRole, Align, Buildable, ConstraintTarget, LayoutManager, Overflow,
7    Widget,
8};
9use glib::{
10    prelude::*,
11    signal::{connect_raw, SignalHandlerId},
12    translate::*,
13};
14use std::boxed::Box as Box_;
15
16glib::wrapper! {
17    /// [`WindowHandle`][crate::WindowHandle] is a titlebar area widget.
18    ///
19    /// When added into a window, it can be dragged to move the window, and handles
20    /// right click, double click and middle click as expected of a titlebar.
21    ///
22    /// # CSS nodes
23    ///
24    /// [`WindowHandle`][crate::WindowHandle] has a single CSS node with the name `windowhandle`.
25    ///
26    /// # Accessibility
27    ///
28    /// Until GTK 4.10, [`WindowHandle`][crate::WindowHandle] used the `GTK_ACCESSIBLE_ROLE_GROUP` role.
29    ///
30    /// Starting from GTK 4.12, [`WindowHandle`][crate::WindowHandle] uses the `GTK_ACCESSIBLE_ROLE_GENERIC` role.
31    ///
32    /// ## Properties
33    ///
34    ///
35    /// #### `child`
36    ///  The child widget.
37    ///
38    /// Readable | Writeable
39    /// <details><summary><h4>Widget</h4></summary>
40    ///
41    ///
42    /// #### `can-focus`
43    ///  Whether the widget or any of its descendents can accept
44    /// the input focus.
45    ///
46    /// This property is meant to be set by widget implementations,
47    /// typically in their instance init function.
48    ///
49    /// Readable | Writeable
50    ///
51    ///
52    /// #### `can-target`
53    ///  Whether the widget can receive pointer events.
54    ///
55    /// Readable | Writeable
56    ///
57    ///
58    /// #### `css-classes`
59    ///  A list of css classes applied to this widget.
60    ///
61    /// Readable | Writeable
62    ///
63    ///
64    /// #### `css-name`
65    ///  The name of this widget in the CSS tree.
66    ///
67    /// This property is meant to be set by widget implementations,
68    /// typically in their instance init function.
69    ///
70    /// Readable | Writeable | Construct Only
71    ///
72    ///
73    /// #### `cursor`
74    ///  The cursor used by @widget.
75    ///
76    /// Readable | Writeable
77    ///
78    ///
79    /// #### `focus-on-click`
80    ///  Whether the widget should grab focus when it is clicked with the mouse.
81    ///
82    /// This property is only relevant for widgets that can take focus.
83    ///
84    /// Readable | Writeable
85    ///
86    ///
87    /// #### `focusable`
88    ///  Whether this widget itself will accept the input focus.
89    ///
90    /// Readable | Writeable
91    ///
92    ///
93    /// #### `halign`
94    ///  How to distribute horizontal space if widget gets extra space.
95    ///
96    /// Readable | Writeable
97    ///
98    ///
99    /// #### `has-default`
100    ///  Whether the widget is the default widget.
101    ///
102    /// Readable
103    ///
104    ///
105    /// #### `has-focus`
106    ///  Whether the widget has the input focus.
107    ///
108    /// Readable
109    ///
110    ///
111    /// #### `has-tooltip`
112    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
113    /// signal on @widget.
114    ///
115    /// A true value indicates that @widget can have a tooltip, in this case
116    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
117    /// determine whether it will provide a tooltip or not.
118    ///
119    /// Readable | Writeable
120    ///
121    ///
122    /// #### `height-request`
123    ///  Overrides for height request of the widget.
124    ///
125    /// If this is -1, the natural request will be used.
126    ///
127    /// Readable | Writeable
128    ///
129    ///
130    /// #### `hexpand`
131    ///  Whether to expand horizontally.
132    ///
133    /// Readable | Writeable
134    ///
135    ///
136    /// #### `hexpand-set`
137    ///  Whether to use the `hexpand` property.
138    ///
139    /// Readable | Writeable
140    ///
141    ///
142    /// #### `layout-manager`
143    ///  The [`LayoutManager`][crate::LayoutManager] instance to use to compute
144    /// the preferred size of the widget, and allocate its children.
145    ///
146    /// This property is meant to be set by widget implementations,
147    /// typically in their instance init function.
148    ///
149    /// Readable | Writeable
150    ///
151    ///
152    /// #### `limit-events`
153    ///  Makes this widget act like a modal dialog, with respect to
154    /// event delivery.
155    ///
156    /// Global event controllers will not handle events with targets
157    /// inside the widget, unless they are set up to ignore propagation
158    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
159    ///
160    /// Readable | Writeable
161    ///
162    ///
163    /// #### `margin-bottom`
164    ///  Margin on bottom side of widget.
165    ///
166    /// This property adds margin outside of the widget's normal size
167    /// request, the margin will be added in addition to the size from
168    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
169    ///
170    /// Readable | Writeable
171    ///
172    ///
173    /// #### `margin-end`
174    ///  Margin on end of widget, horizontally.
175    ///
176    /// This property supports left-to-right and right-to-left text
177    /// directions.
178    ///
179    /// This property adds margin outside of the widget's normal size
180    /// request, the margin will be added in addition to the size from
181    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
182    ///
183    /// Readable | Writeable
184    ///
185    ///
186    /// #### `margin-start`
187    ///  Margin on start of widget, horizontally.
188    ///
189    /// This property supports left-to-right and right-to-left text
190    /// directions.
191    ///
192    /// This property adds margin outside of the widget's normal size
193    /// request, the margin will be added in addition to the size from
194    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
195    ///
196    /// Readable | Writeable
197    ///
198    ///
199    /// #### `margin-top`
200    ///  Margin on top side of widget.
201    ///
202    /// This property adds margin outside of the widget's normal size
203    /// request, the margin will be added in addition to the size from
204    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
205    ///
206    /// Readable | Writeable
207    ///
208    ///
209    /// #### `name`
210    ///  The name of the widget.
211    ///
212    /// Readable | Writeable
213    ///
214    ///
215    /// #### `opacity`
216    ///  The requested opacity of the widget.
217    ///
218    /// Readable | Writeable
219    ///
220    ///
221    /// #### `overflow`
222    ///  How content outside the widget's content area is treated.
223    ///
224    /// This property is meant to be set by widget implementations,
225    /// typically in their instance init function.
226    ///
227    /// Readable | Writeable
228    ///
229    ///
230    /// #### `parent`
231    ///  The parent widget of this widget.
232    ///
233    /// Readable
234    ///
235    ///
236    /// #### `receives-default`
237    ///  Whether the widget will receive the default action when it is focused.
238    ///
239    /// Readable | Writeable
240    ///
241    ///
242    /// #### `root`
243    ///  The [`Root`][crate::Root] widget of the widget tree containing this widget.
244    ///
245    /// This will be `NULL` if the widget is not contained in a root widget.
246    ///
247    /// Readable
248    ///
249    ///
250    /// #### `scale-factor`
251    ///  The scale factor of the widget.
252    ///
253    /// Readable
254    ///
255    ///
256    /// #### `sensitive`
257    ///  Whether the widget responds to input.
258    ///
259    /// Readable | Writeable
260    ///
261    ///
262    /// #### `tooltip-markup`
263    ///  Sets the text of tooltip to be the given string, which is marked up
264    /// with Pango markup.
265    ///
266    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
267    ///
268    /// This is a convenience property which will take care of getting the
269    /// tooltip shown if the given string is not `NULL`:
270    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
271    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
272    /// the default signal handler.
273    ///
274    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
275    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
276    ///
277    /// Readable | Writeable
278    ///
279    ///
280    /// #### `tooltip-text`
281    ///  Sets the text of tooltip to be the given string.
282    ///
283    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
284    ///
285    /// This is a convenience property which will take care of getting the
286    /// tooltip shown if the given string is not `NULL`:
287    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
288    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
289    /// the default signal handler.
290    ///
291    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
292    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
293    ///
294    /// Readable | Writeable
295    ///
296    ///
297    /// #### `valign`
298    ///  How to distribute vertical space if widget gets extra space.
299    ///
300    /// Readable | Writeable
301    ///
302    ///
303    /// #### `vexpand`
304    ///  Whether to expand vertically.
305    ///
306    /// Readable | Writeable
307    ///
308    ///
309    /// #### `vexpand-set`
310    ///  Whether to use the `vexpand` property.
311    ///
312    /// Readable | Writeable
313    ///
314    ///
315    /// #### `visible`
316    ///  Whether the widget is visible.
317    ///
318    /// Readable | Writeable
319    ///
320    ///
321    /// #### `width-request`
322    ///  Overrides for width request of the widget.
323    ///
324    /// If this is -1, the natural request will be used.
325    ///
326    /// Readable | Writeable
327    /// </details>
328    /// <details><summary><h4>Accessible</h4></summary>
329    ///
330    ///
331    /// #### `accessible-role`
332    ///  The accessible role of the given [`Accessible`][crate::Accessible] implementation.
333    ///
334    /// The accessible role cannot be changed once set.
335    ///
336    /// Readable | Writeable
337    /// </details>
338    ///
339    /// # Implements
340    ///
341    /// [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
342    #[doc(alias = "GtkWindowHandle")]
343    pub struct WindowHandle(Object<ffi::GtkWindowHandle, ffi::GtkWindowHandleClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget;
344
345    match fn {
346        type_ => || ffi::gtk_window_handle_get_type(),
347    }
348}
349
350impl WindowHandle {
351    /// Creates a new [`WindowHandle`][crate::WindowHandle].
352    ///
353    /// # Returns
354    ///
355    /// a new [`WindowHandle`][crate::WindowHandle].
356    #[doc(alias = "gtk_window_handle_new")]
357    pub fn new() -> WindowHandle {
358        assert_initialized_main_thread!();
359        unsafe { Widget::from_glib_none(ffi::gtk_window_handle_new()).unsafe_cast() }
360    }
361
362    // rustdoc-stripper-ignore-next
363    /// Creates a new builder-pattern struct instance to construct [`WindowHandle`] objects.
364    ///
365    /// This method returns an instance of [`WindowHandleBuilder`](crate::builders::WindowHandleBuilder) which can be used to create [`WindowHandle`] objects.
366    pub fn builder() -> WindowHandleBuilder {
367        WindowHandleBuilder::new()
368    }
369
370    /// Gets the child widget of @self.
371    ///
372    /// # Returns
373    ///
374    /// the child widget of @self
375    #[doc(alias = "gtk_window_handle_get_child")]
376    #[doc(alias = "get_child")]
377    pub fn child(&self) -> Option<Widget> {
378        unsafe { from_glib_none(ffi::gtk_window_handle_get_child(self.to_glib_none().0)) }
379    }
380
381    /// Sets the child widget of @self.
382    /// ## `child`
383    /// the child widget
384    #[doc(alias = "gtk_window_handle_set_child")]
385    #[doc(alias = "child")]
386    pub fn set_child(&self, child: Option<&impl IsA<Widget>>) {
387        unsafe {
388            ffi::gtk_window_handle_set_child(
389                self.to_glib_none().0,
390                child.map(|p| p.as_ref()).to_glib_none().0,
391            );
392        }
393    }
394
395    #[doc(alias = "child")]
396    pub fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
397        unsafe extern "C" fn notify_child_trampoline<F: Fn(&WindowHandle) + 'static>(
398            this: *mut ffi::GtkWindowHandle,
399            _param_spec: glib::ffi::gpointer,
400            f: glib::ffi::gpointer,
401        ) {
402            let f: &F = &*(f as *const F);
403            f(&from_glib_borrow(this))
404        }
405        unsafe {
406            let f: Box_<F> = Box_::new(f);
407            connect_raw(
408                self.as_ptr() as *mut _,
409                b"notify::child\0".as_ptr() as *const _,
410                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
411                    notify_child_trampoline::<F> as *const (),
412                )),
413                Box_::into_raw(f),
414            )
415        }
416    }
417}
418
419impl Default for WindowHandle {
420    fn default() -> Self {
421        Self::new()
422    }
423}
424
425// rustdoc-stripper-ignore-next
426/// A [builder-pattern] type to construct [`WindowHandle`] objects.
427///
428/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
429#[must_use = "The builder must be built to be used"]
430pub struct WindowHandleBuilder {
431    builder: glib::object::ObjectBuilder<'static, WindowHandle>,
432}
433
434impl WindowHandleBuilder {
435    fn new() -> Self {
436        Self {
437            builder: glib::object::Object::builder(),
438        }
439    }
440
441    /// The child widget.
442    pub fn child(self, child: &impl IsA<Widget>) -> Self {
443        Self {
444            builder: self.builder.property("child", child.clone().upcast()),
445        }
446    }
447
448    /// Whether the widget or any of its descendents can accept
449    /// the input focus.
450    ///
451    /// This property is meant to be set by widget implementations,
452    /// typically in their instance init function.
453    pub fn can_focus(self, can_focus: bool) -> Self {
454        Self {
455            builder: self.builder.property("can-focus", can_focus),
456        }
457    }
458
459    /// Whether the widget can receive pointer events.
460    pub fn can_target(self, can_target: bool) -> Self {
461        Self {
462            builder: self.builder.property("can-target", can_target),
463        }
464    }
465
466    /// A list of css classes applied to this widget.
467    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
468        Self {
469            builder: self.builder.property("css-classes", css_classes.into()),
470        }
471    }
472
473    /// The name of this widget in the CSS tree.
474    ///
475    /// This property is meant to be set by widget implementations,
476    /// typically in their instance init function.
477    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
478        Self {
479            builder: self.builder.property("css-name", css_name.into()),
480        }
481    }
482
483    /// The cursor used by @widget.
484    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
485        Self {
486            builder: self.builder.property("cursor", cursor.clone()),
487        }
488    }
489
490    /// Whether the widget should grab focus when it is clicked with the mouse.
491    ///
492    /// This property is only relevant for widgets that can take focus.
493    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
494        Self {
495            builder: self.builder.property("focus-on-click", focus_on_click),
496        }
497    }
498
499    /// Whether this widget itself will accept the input focus.
500    pub fn focusable(self, focusable: bool) -> Self {
501        Self {
502            builder: self.builder.property("focusable", focusable),
503        }
504    }
505
506    /// How to distribute horizontal space if widget gets extra space.
507    pub fn halign(self, halign: Align) -> Self {
508        Self {
509            builder: self.builder.property("halign", halign),
510        }
511    }
512
513    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
514    /// signal on @widget.
515    ///
516    /// A true value indicates that @widget can have a tooltip, in this case
517    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
518    /// determine whether it will provide a tooltip or not.
519    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
520        Self {
521            builder: self.builder.property("has-tooltip", has_tooltip),
522        }
523    }
524
525    /// Overrides for height request of the widget.
526    ///
527    /// If this is -1, the natural request will be used.
528    pub fn height_request(self, height_request: i32) -> Self {
529        Self {
530            builder: self.builder.property("height-request", height_request),
531        }
532    }
533
534    /// Whether to expand horizontally.
535    pub fn hexpand(self, hexpand: bool) -> Self {
536        Self {
537            builder: self.builder.property("hexpand", hexpand),
538        }
539    }
540
541    /// Whether to use the `hexpand` property.
542    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
543        Self {
544            builder: self.builder.property("hexpand-set", hexpand_set),
545        }
546    }
547
548    /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
549    /// the preferred size of the widget, and allocate its children.
550    ///
551    /// This property is meant to be set by widget implementations,
552    /// typically in their instance init function.
553    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
554        Self {
555            builder: self
556                .builder
557                .property("layout-manager", layout_manager.clone().upcast()),
558        }
559    }
560
561    /// Makes this widget act like a modal dialog, with respect to
562    /// event delivery.
563    ///
564    /// Global event controllers will not handle events with targets
565    /// inside the widget, unless they are set up to ignore propagation
566    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
567    #[cfg(feature = "v4_18")]
568    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
569    pub fn limit_events(self, limit_events: bool) -> Self {
570        Self {
571            builder: self.builder.property("limit-events", limit_events),
572        }
573    }
574
575    /// Margin on bottom side of widget.
576    ///
577    /// This property adds margin outside of the widget's normal size
578    /// request, the margin will be added in addition to the size from
579    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
580    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
581        Self {
582            builder: self.builder.property("margin-bottom", margin_bottom),
583        }
584    }
585
586    /// Margin on end of widget, horizontally.
587    ///
588    /// This property supports left-to-right and right-to-left text
589    /// directions.
590    ///
591    /// This property adds margin outside of the widget's normal size
592    /// request, the margin will be added in addition to the size from
593    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
594    pub fn margin_end(self, margin_end: i32) -> Self {
595        Self {
596            builder: self.builder.property("margin-end", margin_end),
597        }
598    }
599
600    /// Margin on start of widget, horizontally.
601    ///
602    /// This property supports left-to-right and right-to-left text
603    /// directions.
604    ///
605    /// This property adds margin outside of the widget's normal size
606    /// request, the margin will be added in addition to the size from
607    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
608    pub fn margin_start(self, margin_start: i32) -> Self {
609        Self {
610            builder: self.builder.property("margin-start", margin_start),
611        }
612    }
613
614    /// Margin on top side of widget.
615    ///
616    /// This property adds margin outside of the widget's normal size
617    /// request, the margin will be added in addition to the size from
618    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
619    pub fn margin_top(self, margin_top: i32) -> Self {
620        Self {
621            builder: self.builder.property("margin-top", margin_top),
622        }
623    }
624
625    /// The name of the widget.
626    pub fn name(self, name: impl Into<glib::GString>) -> Self {
627        Self {
628            builder: self.builder.property("name", name.into()),
629        }
630    }
631
632    /// The requested opacity of the widget.
633    pub fn opacity(self, opacity: f64) -> Self {
634        Self {
635            builder: self.builder.property("opacity", opacity),
636        }
637    }
638
639    /// How content outside the widget's content area is treated.
640    ///
641    /// This property is meant to be set by widget implementations,
642    /// typically in their instance init function.
643    pub fn overflow(self, overflow: Overflow) -> Self {
644        Self {
645            builder: self.builder.property("overflow", overflow),
646        }
647    }
648
649    /// Whether the widget will receive the default action when it is focused.
650    pub fn receives_default(self, receives_default: bool) -> Self {
651        Self {
652            builder: self.builder.property("receives-default", receives_default),
653        }
654    }
655
656    /// Whether the widget responds to input.
657    pub fn sensitive(self, sensitive: bool) -> Self {
658        Self {
659            builder: self.builder.property("sensitive", sensitive),
660        }
661    }
662
663    /// Sets the text of tooltip to be the given string, which is marked up
664    /// with Pango markup.
665    ///
666    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
667    ///
668    /// This is a convenience property which will take care of getting the
669    /// tooltip shown if the given string is not `NULL`:
670    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
671    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
672    /// the default signal handler.
673    ///
674    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
675    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
676    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
677        Self {
678            builder: self
679                .builder
680                .property("tooltip-markup", tooltip_markup.into()),
681        }
682    }
683
684    /// Sets the text of tooltip to be the given string.
685    ///
686    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
687    ///
688    /// This is a convenience property which will take care of getting the
689    /// tooltip shown if the given string is not `NULL`:
690    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
691    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
692    /// the default signal handler.
693    ///
694    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
695    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
696    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
697        Self {
698            builder: self.builder.property("tooltip-text", tooltip_text.into()),
699        }
700    }
701
702    /// How to distribute vertical space if widget gets extra space.
703    pub fn valign(self, valign: Align) -> Self {
704        Self {
705            builder: self.builder.property("valign", valign),
706        }
707    }
708
709    /// Whether to expand vertically.
710    pub fn vexpand(self, vexpand: bool) -> Self {
711        Self {
712            builder: self.builder.property("vexpand", vexpand),
713        }
714    }
715
716    /// Whether to use the `vexpand` property.
717    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
718        Self {
719            builder: self.builder.property("vexpand-set", vexpand_set),
720        }
721    }
722
723    /// Whether the widget is visible.
724    pub fn visible(self, visible: bool) -> Self {
725        Self {
726            builder: self.builder.property("visible", visible),
727        }
728    }
729
730    /// Overrides for width request of the widget.
731    ///
732    /// If this is -1, the natural request will be used.
733    pub fn width_request(self, width_request: i32) -> Self {
734        Self {
735            builder: self.builder.property("width-request", width_request),
736        }
737    }
738
739    /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
740    ///
741    /// The accessible role cannot be changed once set.
742    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
743        Self {
744            builder: self.builder.property("accessible-role", accessible_role),
745        }
746    }
747
748    // rustdoc-stripper-ignore-next
749    /// Build the [`WindowHandle`].
750    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
751    pub fn build(self) -> WindowHandle {
752        assert_initialized_main_thread!();
753        self.builder.build()
754    }
755}