Skip to main content

gtk4/auto/
info_bar.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, Button, ConstraintTarget, LayoutManager, MessageType,
11    Overflow, ResponseType, Widget, ffi,
12};
13use glib::{
14    object::ObjectType as _,
15    prelude::*,
16    signal::{SignalHandlerId, connect_raw},
17    translate::*,
18};
19use std::boxed::Box as Box_;
20
21#[cfg(feature = "v4_10")]
22#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
23glib::wrapper! {
24    /// There is no replacement in GTK for an "info bar" widget;
25    ///   you can use [`Revealer`][crate::Revealer] with a [`Box`][crate::Box] containing a
26    ///   [`Label`][crate::Label] and an optional [`Button`][crate::Button], according to
27    ///   your application's design.
28    /// [`InfoBar`][crate::InfoBar] can be used to show messages to the user without a dialog.
29    ///
30    /// <picture>
31    ///   <source srcset="info-bar-dark.png" media="(prefers-color-scheme: dark)">
32    ///   <img alt="An example GtkInfoBar" src="info-bar.png">
33    /// </picture>
34    ///
35    /// It is often temporarily shown at the top or bottom of a document.
36    /// In contrast to [`Dialog`][crate::Dialog], which has an action area at the
37    /// bottom, [`InfoBar`][crate::InfoBar] has an action area at the side.
38    ///
39    /// The API of [`InfoBar`][crate::InfoBar] is very similar to [`Dialog`][crate::Dialog], allowing you
40    /// to add buttons to the action area with [`add_button()`][Self::add_button()]
41    /// or [`with_buttons()`][Self::with_buttons()]. The sensitivity of action widgets
42    /// can be controlled with [`set_response_sensitive()`][Self::set_response_sensitive()].
43    ///
44    /// To add widgets to the main content area of a [`InfoBar`][crate::InfoBar], use
45    /// [`add_child()`][Self::add_child()].
46    ///
47    /// Similar to [`MessageDialog`][crate::MessageDialog], the contents of a [`InfoBar`][crate::InfoBar]
48    /// can by classified as error message, warning, informational message, etc,
49    /// by using [`set_message_type()`][Self::set_message_type()]. GTK may use the message
50    /// type to determine how the message is displayed.
51    ///
52    /// A simple example for using a [`InfoBar`][crate::InfoBar]:
53    /// **⚠️ The following code is in c ⚠️**
54    ///
55    /// ```c
56    /// GtkWidget *message_label;
57    /// GtkWidget *widget;
58    /// GtkWidget *grid;
59    /// GtkInfoBar *bar;
60    ///
61    /// // set up info bar
62    /// widget = gtk_info_bar_new ();
63    /// bar = GTK_INFO_BAR (widget);
64    /// grid = gtk_grid_new ();
65    ///
66    /// message_label = gtk_label_new ("");
67    /// gtk_info_bar_add_child (bar, message_label);
68    /// gtk_info_bar_add_button (bar,
69    ///                          _("_OK"),
70    ///                          GTK_RESPONSE_OK);
71    /// g_signal_connect (bar,
72    ///                   "response",
73    ///                   G_CALLBACK (gtk_widget_hide),
74    ///                   NULL);
75    /// gtk_grid_attach (GTK_GRID (grid),
76    ///                  widget,
77    ///                  0, 2, 1, 1);
78    ///
79    /// // ...
80    ///
81    /// // show an error message
82    /// gtk_label_set_text (GTK_LABEL (message_label), "An error occurred!");
83    /// gtk_info_bar_set_message_type (bar, GTK_MESSAGE_ERROR);
84    /// gtk_widget_show (bar);
85    /// ```
86    ///
87    /// # GtkInfoBar as GtkBuildable
88    ///
89    /// [`InfoBar`][crate::InfoBar] supports a custom `<action-widgets>` element, which can contain
90    /// multiple `<action-widget>` elements. The “response” attribute specifies a
91    /// numeric response, and the content of the element is the id of widget
92    /// (which should be a child of the dialogs @action_area).
93    ///
94    /// [`InfoBar`][crate::InfoBar] supports adding action widgets by specifying “action” as
95    /// the “type” attribute of a `<child>` element. The widget will be added
96    /// either to the action area. The response id has to be associated
97    /// with the action widget using the `<action-widgets>` element.
98    ///
99    /// # CSS nodes
100    ///
101    /// [`InfoBar`][crate::InfoBar] has a single CSS node with name infobar. The node may get
102    /// one of the style classes .info, .warning, .error or .question, depending
103    /// on the message type.
104    /// If the info bar shows a close button, that button will have the .close
105    /// style class applied.
106    ///
107    /// ## Properties
108    ///
109    ///
110    /// #### `message-type`
111    ///  The type of the message.
112    ///
113    /// The type may be used to determine the appearance of the info bar.
114    ///
115    /// Readable | Writable | Construct
116    ///
117    ///
118    /// #### `revealed`
119    ///  Whether the info bar shows its contents.
120    ///
121    /// Readable | Writable
122    ///
123    ///
124    /// #### `show-close-button`
125    ///  Whether to include a standard close button.
126    ///
127    /// Readable | Writable | Construct
128    /// <details><summary><h4>Widget</h4></summary>
129    ///
130    ///
131    /// #### `can-focus`
132    ///  Whether the widget or any of its descendents can accept
133    /// the input focus.
134    ///
135    /// This property is meant to be set by widget implementations,
136    /// typically in their instance init function.
137    ///
138    /// Readable | Writable
139    ///
140    ///
141    /// #### `can-target`
142    ///  Whether the widget can receive pointer events.
143    ///
144    /// Readable | Writable
145    ///
146    ///
147    /// #### `css-classes`
148    ///  A list of css classes applied to this widget.
149    ///
150    /// Readable | Writable
151    ///
152    ///
153    /// #### `css-name`
154    ///  The name of this widget in the CSS tree.
155    ///
156    /// This property is meant to be set by widget implementations,
157    /// typically in their instance init function.
158    ///
159    /// Readable | Writable | Construct Only
160    ///
161    ///
162    /// #### `cursor`
163    ///  The cursor used by @widget.
164    ///
165    /// Readable | Writable
166    ///
167    ///
168    /// #### `focus-on-click`
169    ///  Whether the widget should grab focus when it is clicked with the mouse.
170    ///
171    /// This property is only relevant for widgets that can take focus.
172    ///
173    /// Readable | Writable
174    ///
175    ///
176    /// #### `focusable`
177    ///  Whether this widget itself will accept the input focus.
178    ///
179    /// Readable | Writable
180    ///
181    ///
182    /// #### `halign`
183    ///  How to distribute horizontal space if widget gets extra space.
184    ///
185    /// Readable | Writable
186    ///
187    ///
188    /// #### `has-default`
189    ///  Whether the widget is the default widget.
190    ///
191    /// Readable
192    ///
193    ///
194    /// #### `has-focus`
195    ///  Whether the widget has the input focus.
196    ///
197    /// Readable
198    ///
199    ///
200    /// #### `has-tooltip`
201    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
202    /// signal on @widget.
203    ///
204    /// A true value indicates that @widget can have a tooltip, in this case
205    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
206    /// determine whether it will provide a tooltip or not.
207    ///
208    /// Readable | Writable
209    ///
210    ///
211    /// #### `height-request`
212    ///  Overrides for height request of the widget.
213    ///
214    /// If this is -1, the natural request will be used.
215    ///
216    /// Readable | Writable
217    ///
218    ///
219    /// #### `hexpand`
220    ///  Whether to expand horizontally.
221    ///
222    /// Readable | Writable
223    ///
224    ///
225    /// #### `hexpand-set`
226    ///  Whether to use the `hexpand` property.
227    ///
228    /// Readable | Writable
229    ///
230    ///
231    /// #### `layout-manager`
232    ///  The [`LayoutManager`][crate::LayoutManager] instance to use to compute
233    /// the preferred size of the widget, and allocate its children.
234    ///
235    /// This property is meant to be set by widget implementations,
236    /// typically in their instance init function.
237    ///
238    /// Readable | Writable
239    ///
240    ///
241    /// #### `limit-events`
242    ///  Makes this widget act like a modal dialog, with respect to
243    /// event delivery.
244    ///
245    /// Global event controllers will not handle events with targets
246    /// inside the widget, unless they are set up to ignore propagation
247    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
248    ///
249    /// Readable | Writable
250    ///
251    ///
252    /// #### `margin-bottom`
253    ///  Margin on bottom side of widget.
254    ///
255    /// This property adds margin outside of the widget's normal size
256    /// request, the margin will be added in addition to the size from
257    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
258    ///
259    /// Readable | Writable
260    ///
261    ///
262    /// #### `margin-end`
263    ///  Margin on end of widget, horizontally.
264    ///
265    /// This property supports left-to-right and right-to-left text
266    /// directions.
267    ///
268    /// This property adds margin outside of the widget's normal size
269    /// request, the margin will be added in addition to the size from
270    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
271    ///
272    /// Readable | Writable
273    ///
274    ///
275    /// #### `margin-start`
276    ///  Margin on start of widget, horizontally.
277    ///
278    /// This property supports left-to-right and right-to-left text
279    /// directions.
280    ///
281    /// This property adds margin outside of the widget's normal size
282    /// request, the margin will be added in addition to the size from
283    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
284    ///
285    /// Readable | Writable
286    ///
287    ///
288    /// #### `margin-top`
289    ///  Margin on top side of widget.
290    ///
291    /// This property adds margin outside of the widget's normal size
292    /// request, the margin will be added in addition to the size from
293    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
294    ///
295    /// Readable | Writable
296    ///
297    ///
298    /// #### `name`
299    ///  The name of the widget.
300    ///
301    /// Readable | Writable
302    ///
303    ///
304    /// #### `opacity`
305    ///  The requested opacity of the widget.
306    ///
307    /// Readable | Writable
308    ///
309    ///
310    /// #### `overflow`
311    ///  How content outside the widget's content area is treated.
312    ///
313    /// This property is meant to be set by widget implementations,
314    /// typically in their instance init function.
315    ///
316    /// Readable | Writable
317    ///
318    ///
319    /// #### `parent`
320    ///  The parent widget of this widget.
321    ///
322    /// Readable
323    ///
324    ///
325    /// #### `receives-default`
326    ///  Whether the widget will receive the default action when it is focused.
327    ///
328    /// Readable | Writable
329    ///
330    ///
331    /// #### `root`
332    ///  The [`Root`][crate::Root] widget of the widget tree containing this widget.
333    ///
334    /// This will be `NULL` if the widget is not contained in a root widget.
335    ///
336    /// Readable
337    ///
338    ///
339    /// #### `scale-factor`
340    ///  The scale factor of the widget.
341    ///
342    /// Readable
343    ///
344    ///
345    /// #### `sensitive`
346    ///  Whether the widget responds to input.
347    ///
348    /// Readable | Writable
349    ///
350    ///
351    /// #### `tooltip-markup`
352    ///  Sets the text of tooltip to be the given string, which is marked up
353    /// with Pango markup.
354    ///
355    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
356    ///
357    /// This is a convenience property which will take care of getting the
358    /// tooltip shown if the given string is not `NULL`:
359    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
360    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
361    /// the default signal handler.
362    ///
363    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
364    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
365    ///
366    /// Readable | Writable
367    ///
368    ///
369    /// #### `tooltip-text`
370    ///  Sets the text of tooltip to be the given string.
371    ///
372    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
373    ///
374    /// This is a convenience property which will take care of getting the
375    /// tooltip shown if the given string is not `NULL`:
376    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
377    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
378    /// the default signal handler.
379    ///
380    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
381    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
382    ///
383    /// Readable | Writable
384    ///
385    ///
386    /// #### `valign`
387    ///  How to distribute vertical space if widget gets extra space.
388    ///
389    /// Readable | Writable
390    ///
391    ///
392    /// #### `vexpand`
393    ///  Whether to expand vertically.
394    ///
395    /// Readable | Writable
396    ///
397    ///
398    /// #### `vexpand-set`
399    ///  Whether to use the `vexpand` property.
400    ///
401    /// Readable | Writable
402    ///
403    ///
404    /// #### `visible`
405    ///  Whether the widget is visible.
406    ///
407    /// Readable | Writable
408    ///
409    ///
410    /// #### `width-request`
411    ///  Overrides for width request of the widget.
412    ///
413    /// If this is -1, the natural request will be used.
414    ///
415    /// Readable | Writable
416    /// </details>
417    /// <details><summary><h4>Accessible</h4></summary>
418    ///
419    ///
420    /// #### `accessible-role`
421    ///  The accessible role of the given [`Accessible`][crate::Accessible] implementation.
422    ///
423    /// The accessible role cannot be changed once set.
424    ///
425    /// Readable | Writable
426    /// </details>
427    ///
428    /// ## Signals
429    ///
430    ///
431    /// #### `close`
432    ///  Gets emitted when the user uses a keybinding to dismiss the info bar.
433    ///
434    /// The ::close signal is a [keybinding signal](class.SignalAction.html).
435    ///
436    /// The default binding for this signal is the Escape key.
437    ///
438    /// Action
439    ///
440    ///
441    /// #### `response`
442    ///  Emitted when an action widget is clicked.
443    ///
444    /// The signal is also emitted when the application programmer
445    /// calls [`InfoBar::response()`][crate::InfoBar::response()]. The @response_id depends
446    /// on which action widget was clicked.
447    ///
448    ///
449    /// <details><summary><h4>Widget</h4></summary>
450    ///
451    ///
452    /// #### `destroy`
453    ///  Signals that all holders of a reference to the widget should release
454    /// the reference that they hold.
455    ///
456    /// May result in finalization of the widget if all references are released.
457    ///
458    /// This signal is not suitable for saving widget state.
459    ///
460    ///
461    ///
462    ///
463    /// #### `direction-changed`
464    ///  Emitted when the text direction of a widget changes.
465    ///
466    ///
467    ///
468    ///
469    /// #### `hide`
470    ///  Emitted when @widget is hidden.
471    ///
472    ///
473    ///
474    ///
475    /// #### `keynav-failed`
476    ///  Emitted if keyboard navigation fails.
477    ///
478    /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
479    ///
480    ///
481    ///
482    ///
483    /// #### `map`
484    ///  Emitted when @widget is going to be mapped.
485    ///
486    /// A widget is mapped when the widget is visible (which is controlled with
487    /// [`visible`][struct@crate::Widget#visible]) and all its parents up to the toplevel widget
488    /// are also visible.
489    ///
490    /// The `::map` signal can be used to determine whether a widget will be drawn,
491    /// for instance it can resume an animation that was stopped during the
492    /// emission of [`unmap`][struct@crate::Widget#unmap].
493    ///
494    ///
495    ///
496    ///
497    /// #### `mnemonic-activate`
498    ///  Emitted when a widget is activated via a mnemonic.
499    ///
500    /// The default handler for this signal activates @widget if @group_cycling
501    /// is false, or just makes @widget grab focus if @group_cycling is true.
502    ///
503    ///
504    ///
505    ///
506    /// #### `move-focus`
507    ///  Emitted when the focus is moved.
508    ///
509    /// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
510    ///
511    /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
512    /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
513    ///
514    /// Action
515    ///
516    ///
517    /// #### `query-tooltip`
518    ///  Emitted when the widget’s tooltip is about to be shown.
519    ///
520    /// This happens when the [`has-tooltip`][struct@crate::Widget#has-tooltip] property
521    /// is true and the hover timeout has expired with the cursor hovering
522    /// above @widget; or emitted when @widget got focus in keyboard mode.
523    ///
524    /// Using the given coordinates, the signal handler should determine
525    /// whether a tooltip should be shown for @widget. If this is the case
526    /// true should be returned, false otherwise. Note that if @keyboard_mode
527    /// is true, the values of @x and @y are undefined and should not be used.
528    ///
529    /// The signal handler is free to manipulate @tooltip with the therefore
530    /// destined function calls.
531    ///
532    ///
533    ///
534    ///
535    /// #### `realize`
536    ///  Emitted when @widget is associated with a [`gdk::Surface`][crate::gdk::Surface].
537    ///
538    /// This means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called
539    /// or the widget has been mapped (that is, it is going to be drawn).
540    ///
541    ///
542    ///
543    ///
544    /// #### `show`
545    ///  Emitted when @widget is shown.
546    ///
547    ///
548    ///
549    ///
550    /// #### `state-flags-changed`
551    ///  Emitted when the widget state changes.
552    ///
553    /// See [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
554    ///
555    ///
556    ///
557    ///
558    /// #### `unmap`
559    ///  Emitted when @widget is going to be unmapped.
560    ///
561    /// A widget is unmapped when either it or any of its parents up to the
562    /// toplevel widget have been set as hidden.
563    ///
564    /// As `::unmap` indicates that a widget will not be shown any longer,
565    /// it can be used to, for example, stop an animation on the widget.
566    ///
567    ///
568    ///
569    ///
570    /// #### `unrealize`
571    ///  Emitted when the [`gdk::Surface`][crate::gdk::Surface] associated with @widget is destroyed.
572    ///
573    /// This means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been called
574    /// or the widget has been unmapped (that is, it is going to be hidden).
575    ///
576    ///
577    /// </details>
578    ///
579    /// # Implements
580    ///
581    /// [`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]
582    #[doc(alias = "GtkInfoBar")]
583    pub struct InfoBar(Object<ffi::GtkInfoBar>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget;
584
585    match fn {
586        type_ => || ffi::gtk_info_bar_get_type(),
587    }
588}
589
590#[cfg(not(feature = "v4_10"))]
591glib::wrapper! {
592    #[doc(alias = "GtkInfoBar")]
593    pub struct InfoBar(Object<ffi::GtkInfoBar>) @extends Widget, @implements Buildable, ConstraintTarget;
594
595    match fn {
596        type_ => || ffi::gtk_info_bar_get_type(),
597    }
598}
599
600impl InfoBar {
601    /// Creates a new [`InfoBar`][crate::InfoBar] object.
602    ///
603    /// # Deprecated since 4.10
604    ///
605    ///
606    /// # Returns
607    ///
608    /// a new [`InfoBar`][crate::InfoBar] object
609    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
610    #[allow(deprecated)]
611    #[doc(alias = "gtk_info_bar_new")]
612    pub fn new() -> InfoBar {
613        assert_initialized_main_thread!();
614        unsafe { Widget::from_glib_none(ffi::gtk_info_bar_new()).unsafe_cast() }
615    }
616
617    // rustdoc-stripper-ignore-next
618    /// Creates a new builder-pattern struct instance to construct [`InfoBar`] objects.
619    ///
620    /// This method returns an instance of [`InfoBarBuilder`](crate::builders::InfoBarBuilder) which can be used to create [`InfoBar`] objects.
621    pub fn builder() -> InfoBarBuilder {
622        InfoBarBuilder::new()
623    }
624
625    /// Add an activatable widget to the action area of a [`InfoBar`][crate::InfoBar].
626    ///
627    /// This also connects a signal handler that will emit the
628    /// [`response`][struct@crate::InfoBar#response] signal on the message area
629    /// when the widget is activated. The widget is appended to the
630    /// end of the message areas action area.
631    ///
632    /// # Deprecated since 4.10
633    ///
634    /// ## `child`
635    /// an activatable widget
636    /// ## `response_id`
637    /// response ID for @child
638    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
639    #[allow(deprecated)]
640    #[doc(alias = "gtk_info_bar_add_action_widget")]
641    pub fn add_action_widget(&self, child: &impl IsA<Widget>, response_id: ResponseType) {
642        unsafe {
643            ffi::gtk_info_bar_add_action_widget(
644                self.to_glib_none().0,
645                child.as_ref().to_glib_none().0,
646                response_id.into_glib(),
647            );
648        }
649    }
650
651    /// Adds a button with the given text.
652    ///
653    /// Clicking the button will emit the [`response`][struct@crate::InfoBar#response]
654    /// signal with the given response_id. The button is appended to the
655    /// end of the info bar's action area. The button widget is returned,
656    /// but usually you don't need it.
657    ///
658    /// # Deprecated since 4.10
659    ///
660    /// ## `button_text`
661    /// text of button
662    /// ## `response_id`
663    /// response ID for the button
664    ///
665    /// # Returns
666    ///
667    /// the [`Button`][crate::Button] widget
668    /// that was added
669    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
670    #[allow(deprecated)]
671    #[doc(alias = "gtk_info_bar_add_button")]
672    pub fn add_button(&self, button_text: &str, response_id: ResponseType) -> Button {
673        unsafe {
674            from_glib_none(ffi::gtk_info_bar_add_button(
675                self.to_glib_none().0,
676                button_text.to_glib_none().0,
677                response_id.into_glib(),
678            ))
679        }
680    }
681
682    /// Adds a widget to the content area of the info bar.
683    ///
684    /// # Deprecated since 4.10
685    ///
686    /// ## `widget`
687    /// the child to be added
688    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
689    #[allow(deprecated)]
690    #[doc(alias = "gtk_info_bar_add_child")]
691    pub fn add_child(&self, widget: &impl IsA<Widget>) {
692        unsafe {
693            ffi::gtk_info_bar_add_child(self.to_glib_none().0, widget.as_ref().to_glib_none().0);
694        }
695    }
696
697    /// Returns the message type of the message area.
698    ///
699    /// # Deprecated since 4.10
700    ///
701    ///
702    /// # Returns
703    ///
704    /// the message type of the message area.
705    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
706    #[allow(deprecated)]
707    #[doc(alias = "gtk_info_bar_get_message_type")]
708    #[doc(alias = "get_message_type")]
709    #[doc(alias = "message-type")]
710    pub fn message_type(&self) -> MessageType {
711        unsafe { from_glib(ffi::gtk_info_bar_get_message_type(self.to_glib_none().0)) }
712    }
713
714    /// Returns whether the info bar is currently revealed.
715    ///
716    /// # Deprecated since 4.10
717    ///
718    ///
719    /// # Returns
720    ///
721    /// the current value of the [`revealed`][struct@crate::InfoBar#revealed] property
722    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
723    #[allow(deprecated)]
724    #[doc(alias = "gtk_info_bar_get_revealed")]
725    #[doc(alias = "get_revealed")]
726    #[doc(alias = "revealed")]
727    pub fn is_revealed(&self) -> bool {
728        unsafe { from_glib(ffi::gtk_info_bar_get_revealed(self.to_glib_none().0)) }
729    }
730
731    /// Returns whether the widget will display a standard close button.
732    ///
733    /// # Deprecated since 4.10
734    ///
735    ///
736    /// # Returns
737    ///
738    /// [`true`] if the widget displays standard close button
739    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
740    #[allow(deprecated)]
741    #[doc(alias = "gtk_info_bar_get_show_close_button")]
742    #[doc(alias = "get_show_close_button")]
743    #[doc(alias = "show-close-button")]
744    pub fn shows_close_button(&self) -> bool {
745        unsafe {
746            from_glib(ffi::gtk_info_bar_get_show_close_button(
747                self.to_glib_none().0,
748            ))
749        }
750    }
751
752    /// Removes a widget from the action area of @self.
753    ///
754    /// The widget must have been put there by a call to
755    /// [`add_action_widget()`][Self::add_action_widget()] or [`add_button()`][Self::add_button()].
756    ///
757    /// # Deprecated since 4.10
758    ///
759    /// ## `widget`
760    /// an action widget to remove
761    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
762    #[allow(deprecated)]
763    #[doc(alias = "gtk_info_bar_remove_action_widget")]
764    pub fn remove_action_widget(&self, widget: &impl IsA<Widget>) {
765        unsafe {
766            ffi::gtk_info_bar_remove_action_widget(
767                self.to_glib_none().0,
768                widget.as_ref().to_glib_none().0,
769            );
770        }
771    }
772
773    /// Removes a widget from the content area of the info bar.
774    ///
775    /// # Deprecated since 4.10
776    ///
777    /// ## `widget`
778    /// a child that has been added to the content area
779    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
780    #[allow(deprecated)]
781    #[doc(alias = "gtk_info_bar_remove_child")]
782    pub fn remove_child(&self, widget: &impl IsA<Widget>) {
783        unsafe {
784            ffi::gtk_info_bar_remove_child(self.to_glib_none().0, widget.as_ref().to_glib_none().0);
785        }
786    }
787
788    /// Emits the “response” signal with the given @response_id.
789    ///
790    /// # Deprecated since 4.10
791    ///
792    /// ## `response_id`
793    /// a response ID
794    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
795    #[allow(deprecated)]
796    #[doc(alias = "gtk_info_bar_response")]
797    pub fn response(&self, response_id: ResponseType) {
798        unsafe {
799            ffi::gtk_info_bar_response(self.to_glib_none().0, response_id.into_glib());
800        }
801    }
802
803    /// Sets the last widget in the info bar’s action area with
804    /// the given response_id as the default widget for the dialog.
805    ///
806    /// Pressing “Enter” normally activates the default widget.
807    ///
808    /// Note that this function currently requires @self to
809    /// be added to a widget hierarchy.
810    ///
811    /// # Deprecated since 4.10
812    ///
813    /// ## `response_id`
814    /// a response ID
815    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
816    #[allow(deprecated)]
817    #[doc(alias = "gtk_info_bar_set_default_response")]
818    pub fn set_default_response(&self, response_id: ResponseType) {
819        unsafe {
820            ffi::gtk_info_bar_set_default_response(self.to_glib_none().0, response_id.into_glib());
821        }
822    }
823
824    /// Sets the message type of the message area.
825    ///
826    /// GTK uses this type to determine how the message is displayed.
827    ///
828    /// # Deprecated since 4.10
829    ///
830    /// ## `message_type`
831    /// a [`MessageType`][crate::MessageType]
832    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
833    #[allow(deprecated)]
834    #[doc(alias = "gtk_info_bar_set_message_type")]
835    #[doc(alias = "message-type")]
836    pub fn set_message_type(&self, message_type: MessageType) {
837        unsafe {
838            ffi::gtk_info_bar_set_message_type(self.to_glib_none().0, message_type.into_glib());
839        }
840    }
841
842    /// Sets the sensitivity of action widgets for @response_id.
843    ///
844    /// Calls `gtk_widget_set_sensitive (widget, setting)` for each
845    /// widget in the info bars’s action area with the given @response_id.
846    /// A convenient way to sensitize/desensitize buttons.
847    ///
848    /// # Deprecated since 4.10
849    ///
850    /// ## `response_id`
851    /// a response ID
852    /// ## `setting`
853    /// TRUE for sensitive
854    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
855    #[allow(deprecated)]
856    #[doc(alias = "gtk_info_bar_set_response_sensitive")]
857    pub fn set_response_sensitive(&self, response_id: ResponseType, setting: bool) {
858        unsafe {
859            ffi::gtk_info_bar_set_response_sensitive(
860                self.to_glib_none().0,
861                response_id.into_glib(),
862                setting.into_glib(),
863            );
864        }
865    }
866
867    /// Sets whether the [`InfoBar`][crate::InfoBar] is revealed.
868    ///
869    /// Changing this will make @self reveal or conceal
870    /// itself via a sliding transition.
871    ///
872    /// Note: this does not show or hide @self in the
873    /// [`visible`][struct@crate::Widget#visible] sense, so revealing has no effect
874    /// if [`visible`][struct@crate::Widget#visible] is [`false`].
875    ///
876    /// # Deprecated since 4.10
877    ///
878    /// ## `revealed`
879    /// The new value of the property
880    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
881    #[allow(deprecated)]
882    #[doc(alias = "gtk_info_bar_set_revealed")]
883    #[doc(alias = "revealed")]
884    pub fn set_revealed(&self, revealed: bool) {
885        unsafe {
886            ffi::gtk_info_bar_set_revealed(self.to_glib_none().0, revealed.into_glib());
887        }
888    }
889
890    /// If true, a standard close button is shown.
891    ///
892    /// When clicked it emits the response [`ResponseType::Close`][crate::ResponseType::Close].
893    ///
894    /// # Deprecated since 4.10
895    ///
896    /// ## `setting`
897    /// [`true`] to include a close button
898    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
899    #[allow(deprecated)]
900    #[doc(alias = "gtk_info_bar_set_show_close_button")]
901    #[doc(alias = "show-close-button")]
902    pub fn set_show_close_button(&self, setting: bool) {
903        unsafe {
904            ffi::gtk_info_bar_set_show_close_button(self.to_glib_none().0, setting.into_glib());
905        }
906    }
907
908    /// Gets emitted when the user uses a keybinding to dismiss the info bar.
909    ///
910    /// The ::close signal is a [keybinding signal](class.SignalAction.html).
911    ///
912    /// The default binding for this signal is the Escape key.
913    #[doc(alias = "close")]
914    pub fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
915        unsafe extern "C" fn close_trampoline<F: Fn(&InfoBar) + 'static>(
916            this: *mut ffi::GtkInfoBar,
917            f: glib::ffi::gpointer,
918        ) {
919            unsafe {
920                let f: &F = &*(f as *const F);
921                f(&from_glib_borrow(this))
922            }
923        }
924        unsafe {
925            let f: Box_<F> = Box_::new(f);
926            connect_raw(
927                self.as_ptr() as *mut _,
928                c"close".as_ptr(),
929                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
930                    close_trampoline::<F> as *const (),
931                )),
932                Box_::into_raw(f),
933            )
934        }
935    }
936
937    pub fn emit_close(&self) {
938        self.emit_by_name::<()>("close", &[]);
939    }
940
941    /// Emitted when an action widget is clicked.
942    ///
943    /// The signal is also emitted when the application programmer
944    /// calls [`response()`][Self::response()]. The @response_id depends
945    /// on which action widget was clicked.
946    /// ## `response_id`
947    /// the response ID
948    #[doc(alias = "response")]
949    pub fn connect_response<F: Fn(&Self, ResponseType) + 'static>(&self, f: F) -> SignalHandlerId {
950        unsafe extern "C" fn response_trampoline<F: Fn(&InfoBar, ResponseType) + 'static>(
951            this: *mut ffi::GtkInfoBar,
952            response_id: ffi::GtkResponseType,
953            f: glib::ffi::gpointer,
954        ) {
955            unsafe {
956                let f: &F = &*(f as *const F);
957                f(&from_glib_borrow(this), from_glib(response_id))
958            }
959        }
960        unsafe {
961            let f: Box_<F> = Box_::new(f);
962            connect_raw(
963                self.as_ptr() as *mut _,
964                c"response".as_ptr(),
965                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
966                    response_trampoline::<F> as *const (),
967                )),
968                Box_::into_raw(f),
969            )
970        }
971    }
972
973    #[doc(alias = "message-type")]
974    pub fn connect_message_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
975        unsafe extern "C" fn notify_message_type_trampoline<F: Fn(&InfoBar) + 'static>(
976            this: *mut ffi::GtkInfoBar,
977            _param_spec: glib::ffi::gpointer,
978            f: glib::ffi::gpointer,
979        ) {
980            unsafe {
981                let f: &F = &*(f as *const F);
982                f(&from_glib_borrow(this))
983            }
984        }
985        unsafe {
986            let f: Box_<F> = Box_::new(f);
987            connect_raw(
988                self.as_ptr() as *mut _,
989                c"notify::message-type".as_ptr(),
990                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
991                    notify_message_type_trampoline::<F> as *const (),
992                )),
993                Box_::into_raw(f),
994            )
995        }
996    }
997
998    #[doc(alias = "revealed")]
999    pub fn connect_revealed_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1000        unsafe extern "C" fn notify_revealed_trampoline<F: Fn(&InfoBar) + 'static>(
1001            this: *mut ffi::GtkInfoBar,
1002            _param_spec: glib::ffi::gpointer,
1003            f: glib::ffi::gpointer,
1004        ) {
1005            unsafe {
1006                let f: &F = &*(f as *const F);
1007                f(&from_glib_borrow(this))
1008            }
1009        }
1010        unsafe {
1011            let f: Box_<F> = Box_::new(f);
1012            connect_raw(
1013                self.as_ptr() as *mut _,
1014                c"notify::revealed".as_ptr(),
1015                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1016                    notify_revealed_trampoline::<F> as *const (),
1017                )),
1018                Box_::into_raw(f),
1019            )
1020        }
1021    }
1022
1023    #[doc(alias = "show-close-button")]
1024    pub fn connect_show_close_button_notify<F: Fn(&Self) + 'static>(
1025        &self,
1026        f: F,
1027    ) -> SignalHandlerId {
1028        unsafe extern "C" fn notify_show_close_button_trampoline<F: Fn(&InfoBar) + 'static>(
1029            this: *mut ffi::GtkInfoBar,
1030            _param_spec: glib::ffi::gpointer,
1031            f: glib::ffi::gpointer,
1032        ) {
1033            unsafe {
1034                let f: &F = &*(f as *const F);
1035                f(&from_glib_borrow(this))
1036            }
1037        }
1038        unsafe {
1039            let f: Box_<F> = Box_::new(f);
1040            connect_raw(
1041                self.as_ptr() as *mut _,
1042                c"notify::show-close-button".as_ptr(),
1043                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1044                    notify_show_close_button_trampoline::<F> as *const (),
1045                )),
1046                Box_::into_raw(f),
1047            )
1048        }
1049    }
1050}
1051
1052impl Default for InfoBar {
1053    fn default() -> Self {
1054        Self::new()
1055    }
1056}
1057
1058// rustdoc-stripper-ignore-next
1059/// A [builder-pattern] type to construct [`InfoBar`] objects.
1060///
1061/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1062#[must_use = "The builder must be built to be used"]
1063pub struct InfoBarBuilder {
1064    builder: glib::object::ObjectBuilder<'static, InfoBar>,
1065}
1066
1067impl InfoBarBuilder {
1068    fn new() -> Self {
1069        Self {
1070            builder: glib::object::Object::builder(),
1071        }
1072    }
1073
1074    /// The type of the message.
1075    ///
1076    /// The type may be used to determine the appearance of the info bar.
1077    pub fn message_type(self, message_type: MessageType) -> Self {
1078        Self {
1079            builder: self.builder.property("message-type", message_type),
1080        }
1081    }
1082
1083    /// Whether the info bar shows its contents.
1084    pub fn revealed(self, revealed: bool) -> Self {
1085        Self {
1086            builder: self.builder.property("revealed", revealed),
1087        }
1088    }
1089
1090    /// Whether to include a standard close button.
1091    pub fn show_close_button(self, show_close_button: bool) -> Self {
1092        Self {
1093            builder: self
1094                .builder
1095                .property("show-close-button", show_close_button),
1096        }
1097    }
1098
1099    /// Whether the widget or any of its descendents can accept
1100    /// the input focus.
1101    ///
1102    /// This property is meant to be set by widget implementations,
1103    /// typically in their instance init function.
1104    pub fn can_focus(self, can_focus: bool) -> Self {
1105        Self {
1106            builder: self.builder.property("can-focus", can_focus),
1107        }
1108    }
1109
1110    /// Whether the widget can receive pointer events.
1111    pub fn can_target(self, can_target: bool) -> Self {
1112        Self {
1113            builder: self.builder.property("can-target", can_target),
1114        }
1115    }
1116
1117    /// A list of css classes applied to this widget.
1118    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
1119        Self {
1120            builder: self.builder.property("css-classes", css_classes.into()),
1121        }
1122    }
1123
1124    /// The name of this widget in the CSS tree.
1125    ///
1126    /// This property is meant to be set by widget implementations,
1127    /// typically in their instance init function.
1128    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
1129        Self {
1130            builder: self.builder.property("css-name", css_name.into()),
1131        }
1132    }
1133
1134    /// The cursor used by @widget.
1135    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
1136        Self {
1137            builder: self.builder.property("cursor", cursor.clone()),
1138        }
1139    }
1140
1141    /// Whether the widget should grab focus when it is clicked with the mouse.
1142    ///
1143    /// This property is only relevant for widgets that can take focus.
1144    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1145        Self {
1146            builder: self.builder.property("focus-on-click", focus_on_click),
1147        }
1148    }
1149
1150    /// Whether this widget itself will accept the input focus.
1151    pub fn focusable(self, focusable: bool) -> Self {
1152        Self {
1153            builder: self.builder.property("focusable", focusable),
1154        }
1155    }
1156
1157    /// How to distribute horizontal space if widget gets extra space.
1158    pub fn halign(self, halign: Align) -> Self {
1159        Self {
1160            builder: self.builder.property("halign", halign),
1161        }
1162    }
1163
1164    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
1165    /// signal on @widget.
1166    ///
1167    /// A true value indicates that @widget can have a tooltip, in this case
1168    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
1169    /// determine whether it will provide a tooltip or not.
1170    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1171        Self {
1172            builder: self.builder.property("has-tooltip", has_tooltip),
1173        }
1174    }
1175
1176    /// Overrides for height request of the widget.
1177    ///
1178    /// If this is -1, the natural request will be used.
1179    pub fn height_request(self, height_request: i32) -> Self {
1180        Self {
1181            builder: self.builder.property("height-request", height_request),
1182        }
1183    }
1184
1185    /// Whether to expand horizontally.
1186    pub fn hexpand(self, hexpand: bool) -> Self {
1187        Self {
1188            builder: self.builder.property("hexpand", hexpand),
1189        }
1190    }
1191
1192    /// Whether to use the `hexpand` property.
1193    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1194        Self {
1195            builder: self.builder.property("hexpand-set", hexpand_set),
1196        }
1197    }
1198
1199    /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
1200    /// the preferred size of the widget, and allocate its children.
1201    ///
1202    /// This property is meant to be set by widget implementations,
1203    /// typically in their instance init function.
1204    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
1205        Self {
1206            builder: self
1207                .builder
1208                .property("layout-manager", layout_manager.clone().upcast()),
1209        }
1210    }
1211
1212    /// Makes this widget act like a modal dialog, with respect to
1213    /// event delivery.
1214    ///
1215    /// Global event controllers will not handle events with targets
1216    /// inside the widget, unless they are set up to ignore propagation
1217    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
1218    #[cfg(feature = "v4_18")]
1219    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
1220    pub fn limit_events(self, limit_events: bool) -> Self {
1221        Self {
1222            builder: self.builder.property("limit-events", limit_events),
1223        }
1224    }
1225
1226    /// Margin on bottom side of widget.
1227    ///
1228    /// This property adds margin outside of the widget's normal size
1229    /// request, the margin will be added in addition to the size from
1230    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1231    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1232        Self {
1233            builder: self.builder.property("margin-bottom", margin_bottom),
1234        }
1235    }
1236
1237    /// Margin on end of widget, horizontally.
1238    ///
1239    /// This property supports left-to-right and right-to-left text
1240    /// directions.
1241    ///
1242    /// This property adds margin outside of the widget's normal size
1243    /// request, the margin will be added in addition to the size from
1244    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1245    pub fn margin_end(self, margin_end: i32) -> Self {
1246        Self {
1247            builder: self.builder.property("margin-end", margin_end),
1248        }
1249    }
1250
1251    /// Margin on start of widget, horizontally.
1252    ///
1253    /// This property supports left-to-right and right-to-left text
1254    /// directions.
1255    ///
1256    /// This property adds margin outside of the widget's normal size
1257    /// request, the margin will be added in addition to the size from
1258    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1259    pub fn margin_start(self, margin_start: i32) -> Self {
1260        Self {
1261            builder: self.builder.property("margin-start", margin_start),
1262        }
1263    }
1264
1265    /// Margin on top side of widget.
1266    ///
1267    /// This property adds margin outside of the widget's normal size
1268    /// request, the margin will be added in addition to the size from
1269    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1270    pub fn margin_top(self, margin_top: i32) -> Self {
1271        Self {
1272            builder: self.builder.property("margin-top", margin_top),
1273        }
1274    }
1275
1276    /// The name of the widget.
1277    pub fn name(self, name: impl Into<glib::GString>) -> Self {
1278        Self {
1279            builder: self.builder.property("name", name.into()),
1280        }
1281    }
1282
1283    /// The requested opacity of the widget.
1284    pub fn opacity(self, opacity: f64) -> Self {
1285        Self {
1286            builder: self.builder.property("opacity", opacity),
1287        }
1288    }
1289
1290    /// How content outside the widget's content area is treated.
1291    ///
1292    /// This property is meant to be set by widget implementations,
1293    /// typically in their instance init function.
1294    pub fn overflow(self, overflow: Overflow) -> Self {
1295        Self {
1296            builder: self.builder.property("overflow", overflow),
1297        }
1298    }
1299
1300    /// Whether the widget will receive the default action when it is focused.
1301    pub fn receives_default(self, receives_default: bool) -> Self {
1302        Self {
1303            builder: self.builder.property("receives-default", receives_default),
1304        }
1305    }
1306
1307    /// Whether the widget responds to input.
1308    pub fn sensitive(self, sensitive: bool) -> Self {
1309        Self {
1310            builder: self.builder.property("sensitive", sensitive),
1311        }
1312    }
1313
1314    /// Sets the text of tooltip to be the given string, which is marked up
1315    /// with Pango markup.
1316    ///
1317    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1318    ///
1319    /// This is a convenience property which will take care of getting the
1320    /// tooltip shown if the given string is not `NULL`:
1321    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1322    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1323    /// the default signal handler.
1324    ///
1325    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1326    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1327    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1328        Self {
1329            builder: self
1330                .builder
1331                .property("tooltip-markup", tooltip_markup.into()),
1332        }
1333    }
1334
1335    /// Sets the text of tooltip to be the given string.
1336    ///
1337    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1338    ///
1339    /// This is a convenience property which will take care of getting the
1340    /// tooltip shown if the given string is not `NULL`:
1341    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1342    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1343    /// the default signal handler.
1344    ///
1345    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1346    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1347    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1348        Self {
1349            builder: self.builder.property("tooltip-text", tooltip_text.into()),
1350        }
1351    }
1352
1353    /// How to distribute vertical space if widget gets extra space.
1354    pub fn valign(self, valign: Align) -> Self {
1355        Self {
1356            builder: self.builder.property("valign", valign),
1357        }
1358    }
1359
1360    /// Whether to expand vertically.
1361    pub fn vexpand(self, vexpand: bool) -> Self {
1362        Self {
1363            builder: self.builder.property("vexpand", vexpand),
1364        }
1365    }
1366
1367    /// Whether to use the `vexpand` property.
1368    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1369        Self {
1370            builder: self.builder.property("vexpand-set", vexpand_set),
1371        }
1372    }
1373
1374    /// Whether the widget is visible.
1375    pub fn visible(self, visible: bool) -> Self {
1376        Self {
1377            builder: self.builder.property("visible", visible),
1378        }
1379    }
1380
1381    /// Overrides for width request of the widget.
1382    ///
1383    /// If this is -1, the natural request will be used.
1384    pub fn width_request(self, width_request: i32) -> Self {
1385        Self {
1386            builder: self.builder.property("width-request", width_request),
1387        }
1388    }
1389
1390    /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
1391    ///
1392    /// The accessible role cannot be changed once set.
1393    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
1394        Self {
1395            builder: self.builder.property("accessible-role", accessible_role),
1396        }
1397    }
1398
1399    // rustdoc-stripper-ignore-next
1400    /// Build the [`InfoBar`].
1401    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1402    pub fn build(self) -> InfoBar {
1403        assert_initialized_main_thread!();
1404        self.builder.build()
1405    }
1406}