Skip to main content

gtk4/auto/
statusbar.rs

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