gtk4/auto/
page_setup_unix_dialog.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, Application, Buildable, ConstraintTarget, Dialog,
7    LayoutManager, Native, Overflow, PageSetup, PrintSettings, Root, ShortcutManager, Widget,
8    Window,
9};
10use glib::{prelude::*, translate::*};
11
12glib::wrapper! {
13    /// [`PageSetupUnixDialog`][crate::PageSetupUnixDialog] implements a page setup dialog for platforms
14    /// which don’t provide a native page setup dialog, like Unix.
15    ///
16    /// ![An example GtkPageSetupUnixDialog](pagesetupdialog.png)
17    ///
18    /// It can be used very much like any other GTK dialog, at the
19    /// cost of the portability offered by the high-level printing
20    /// API in [`PrintOperation`][crate::PrintOperation].
21    ///
22    /// ## CSS nodes
23    ///
24    /// [`PageSetupUnixDialog`][crate::PageSetupUnixDialog] has a single CSS node with the name `window` and
25    /// style class `.pagesetup`.
26    ///
27    /// # Implements
28    ///
29    /// [`DialogExt`][trait@crate::prelude::DialogExt], [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`NativeExt`][trait@crate::prelude::NativeExt], [`RootExt`][trait@crate::prelude::RootExt], [`ShortcutManagerExt`][trait@crate::prelude::ShortcutManagerExt], [`DialogExtManual`][trait@crate::prelude::DialogExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
30    #[doc(alias = "GtkPageSetupUnixDialog")]
31    pub struct PageSetupUnixDialog(Object<ffi::GtkPageSetupUnixDialog>) @extends Dialog, Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager;
32
33    match fn {
34        type_ => || ffi::gtk_page_setup_unix_dialog_get_type(),
35    }
36}
37
38impl PageSetupUnixDialog {
39    /// Creates a new page setup dialog.
40    /// ## `title`
41    /// the title of the dialog
42    /// ## `parent`
43    /// transient parent of the dialog
44    ///
45    /// # Returns
46    ///
47    /// the new [`PageSetupUnixDialog`][crate::PageSetupUnixDialog]
48    #[doc(alias = "gtk_page_setup_unix_dialog_new")]
49    pub fn new(title: Option<&str>, parent: Option<&impl IsA<Window>>) -> PageSetupUnixDialog {
50        assert_initialized_main_thread!();
51        unsafe {
52            Widget::from_glib_none(ffi::gtk_page_setup_unix_dialog_new(
53                title.to_glib_none().0,
54                parent.map(|p| p.as_ref()).to_glib_none().0,
55            ))
56            .unsafe_cast()
57        }
58    }
59
60    // rustdoc-stripper-ignore-next
61    /// Creates a new builder-pattern struct instance to construct [`PageSetupUnixDialog`] objects.
62    ///
63    /// This method returns an instance of [`PageSetupUnixDialogBuilder`](crate::builders::PageSetupUnixDialogBuilder) which can be used to create [`PageSetupUnixDialog`] objects.
64    pub fn builder() -> PageSetupUnixDialogBuilder {
65        PageSetupUnixDialogBuilder::new()
66    }
67
68    /// Gets the currently selected page setup from the dialog.
69    ///
70    /// # Returns
71    ///
72    /// the current page setup
73    #[doc(alias = "gtk_page_setup_unix_dialog_get_page_setup")]
74    #[doc(alias = "get_page_setup")]
75    pub fn page_setup(&self) -> PageSetup {
76        unsafe {
77            from_glib_none(ffi::gtk_page_setup_unix_dialog_get_page_setup(
78                self.to_glib_none().0,
79            ))
80        }
81    }
82
83    /// Gets the current print settings from the dialog.
84    ///
85    /// # Returns
86    ///
87    /// the current print settings
88    #[doc(alias = "gtk_page_setup_unix_dialog_get_print_settings")]
89    #[doc(alias = "get_print_settings")]
90    pub fn print_settings(&self) -> Option<PrintSettings> {
91        unsafe {
92            from_glib_none(ffi::gtk_page_setup_unix_dialog_get_print_settings(
93                self.to_glib_none().0,
94            ))
95        }
96    }
97
98    /// Sets the [`PageSetup`][crate::PageSetup] from which the page setup
99    /// dialog takes its values.
100    /// ## `page_setup`
101    /// a [`PageSetup`][crate::PageSetup]
102    #[doc(alias = "gtk_page_setup_unix_dialog_set_page_setup")]
103    pub fn set_page_setup(&self, page_setup: &PageSetup) {
104        unsafe {
105            ffi::gtk_page_setup_unix_dialog_set_page_setup(
106                self.to_glib_none().0,
107                page_setup.to_glib_none().0,
108            );
109        }
110    }
111
112    /// Sets the [`PrintSettings`][crate::PrintSettings] from which the page setup dialog
113    /// takes its values.
114    /// ## `print_settings`
115    /// a [`PrintSettings`][crate::PrintSettings]
116    #[doc(alias = "gtk_page_setup_unix_dialog_set_print_settings")]
117    pub fn set_print_settings(&self, print_settings: Option<&PrintSettings>) {
118        unsafe {
119            ffi::gtk_page_setup_unix_dialog_set_print_settings(
120                self.to_glib_none().0,
121                print_settings.to_glib_none().0,
122            );
123        }
124    }
125}
126
127impl Default for PageSetupUnixDialog {
128    fn default() -> Self {
129        glib::object::Object::new::<Self>()
130    }
131}
132
133// rustdoc-stripper-ignore-next
134/// A [builder-pattern] type to construct [`PageSetupUnixDialog`] objects.
135///
136/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
137#[must_use = "The builder must be built to be used"]
138pub struct PageSetupUnixDialogBuilder {
139    builder: glib::object::ObjectBuilder<'static, PageSetupUnixDialog>,
140}
141
142impl PageSetupUnixDialogBuilder {
143    fn new() -> Self {
144        Self {
145            builder: glib::object::Object::builder(),
146        }
147    }
148
149    /// [`true`] if the dialog uses a headerbar for action buttons
150    /// instead of the action-area.
151    ///
152    /// For technical reasons, this property is declared as an integer
153    /// property, but you should only set it to [`true`] or [`false`].
154    ///
155    /// ## Creating a dialog with headerbar
156    ///
157    /// Builtin [`Dialog`][crate::Dialog] subclasses such as [`ColorChooserDialog`][crate::ColorChooserDialog]
158    /// set this property according to platform conventions (using the
159    /// [`gtk-dialogs-use-header`][struct@crate::Settings#gtk-dialogs-use-header] setting).
160    ///
161    /// Here is how you can achieve the same:
162    ///
163    /// **⚠️ The following code is in c ⚠️**
164    ///
165    /// ```c
166    /// g_object_get (settings, "gtk-dialogs-use-header", &header, NULL);
167    /// dialog = g_object_new (GTK_TYPE_DIALOG, header, TRUE, NULL);
168    /// ```
169    /// Use [`Window`][crate::Window] instead
170    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
171    pub fn use_header_bar(self, use_header_bar: i32) -> Self {
172        Self {
173            builder: self.builder.property("use-header-bar", use_header_bar),
174        }
175    }
176
177    /// The [`Application`][crate::Application] associated with the window.
178    ///
179    /// The application will be kept alive for at least as long as it
180    /// has any windows associated with it (see g_application_hold()
181    /// for a way to keep it alive without windows).
182    ///
183    /// Normally, the connection between the application and the window
184    /// will remain until the window is destroyed, but you can explicitly
185    /// remove it by setting the this property to `NULL`.
186    pub fn application(self, application: &impl IsA<Application>) -> Self {
187        Self {
188            builder: self
189                .builder
190                .property("application", application.clone().upcast()),
191        }
192    }
193
194    /// The child widget.
195    pub fn child(self, child: &impl IsA<Widget>) -> Self {
196        Self {
197            builder: self.builder.property("child", child.clone().upcast()),
198        }
199    }
200
201    /// Whether the window should have a frame (also known as *decorations*).
202    pub fn decorated(self, decorated: bool) -> Self {
203        Self {
204            builder: self.builder.property("decorated", decorated),
205        }
206    }
207
208    /// The default height of the window.
209    pub fn default_height(self, default_height: i32) -> Self {
210        Self {
211            builder: self.builder.property("default-height", default_height),
212        }
213    }
214
215    /// The default widget.
216    pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
217        Self {
218            builder: self
219                .builder
220                .property("default-widget", default_widget.clone().upcast()),
221        }
222    }
223
224    /// The default width of the window.
225    pub fn default_width(self, default_width: i32) -> Self {
226        Self {
227            builder: self.builder.property("default-width", default_width),
228        }
229    }
230
231    /// Whether the window frame should have a close button.
232    pub fn deletable(self, deletable: bool) -> Self {
233        Self {
234            builder: self.builder.property("deletable", deletable),
235        }
236    }
237
238    /// If this window should be destroyed when the parent is destroyed.
239    pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
240        Self {
241            builder: self
242                .builder
243                .property("destroy-with-parent", destroy_with_parent),
244        }
245    }
246
247    /// The display that will display this window.
248    pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
249        Self {
250            builder: self.builder.property("display", display.clone().upcast()),
251        }
252    }
253
254    /// Whether 'focus rectangles' are currently visible in this window.
255    ///
256    /// This property is maintained by GTK based on user input
257    /// and should not be set by applications.
258    pub fn focus_visible(self, focus_visible: bool) -> Self {
259        Self {
260            builder: self.builder.property("focus-visible", focus_visible),
261        }
262    }
263
264    /// The focus widget.
265    pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
266        Self {
267            builder: self
268                .builder
269                .property("focus-widget", focus_widget.clone().upcast()),
270        }
271    }
272
273    /// Whether the window is fullscreen.
274    ///
275    /// Setting this property is the equivalent of calling
276    /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
277    /// either operation is asynchronous, which means you will need to
278    /// connect to the ::notify signal in order to know whether the
279    /// operation was successful.
280    pub fn fullscreened(self, fullscreened: bool) -> Self {
281        Self {
282            builder: self.builder.property("fullscreened", fullscreened),
283        }
284    }
285
286    /// Whether the window frame should handle <kbd>F10</kbd> for activating
287    /// menubars.
288    #[cfg(feature = "v4_2")]
289    #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
290    pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
291        Self {
292            builder: self
293                .builder
294                .property("handle-menubar-accel", handle_menubar_accel),
295        }
296    }
297
298    /// If this window should be hidden when the users clicks the close button.
299    pub fn hide_on_close(self, hide_on_close: bool) -> Self {
300        Self {
301            builder: self.builder.property("hide-on-close", hide_on_close),
302        }
303    }
304
305    /// Specifies the name of the themed icon to use as the window icon.
306    ///
307    /// See [`IconTheme`][crate::IconTheme] for more details.
308    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
309        Self {
310            builder: self.builder.property("icon-name", icon_name.into()),
311        }
312    }
313
314    /// Whether the window is maximized.
315    ///
316    /// Setting this property is the equivalent of calling
317    /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
318    /// either operation is asynchronous, which means you will need to
319    /// connect to the ::notify signal in order to know whether the
320    /// operation was successful.
321    pub fn maximized(self, maximized: bool) -> Self {
322        Self {
323            builder: self.builder.property("maximized", maximized),
324        }
325    }
326
327    /// Whether mnemonics are currently visible in this window.
328    ///
329    /// This property is maintained by GTK based on user input,
330    /// and should not be set by applications.
331    pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
332        Self {
333            builder: self
334                .builder
335                .property("mnemonics-visible", mnemonics_visible),
336        }
337    }
338
339    /// If true, the window is modal.
340    pub fn modal(self, modal: bool) -> Self {
341        Self {
342            builder: self.builder.property("modal", modal),
343        }
344    }
345
346    /// If true, users can resize the window.
347    pub fn resizable(self, resizable: bool) -> Self {
348        Self {
349            builder: self.builder.property("resizable", resizable),
350        }
351    }
352
353    /// A write-only property for setting window's startup notification identifier.
354    pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
355        Self {
356            builder: self.builder.property("startup-id", startup_id.into()),
357        }
358    }
359
360    /// The title of the window.
361    pub fn title(self, title: impl Into<glib::GString>) -> Self {
362        Self {
363            builder: self.builder.property("title", title.into()),
364        }
365    }
366
367    /// The titlebar widget.
368    #[cfg(feature = "v4_6")]
369    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
370    pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
371        Self {
372            builder: self.builder.property("titlebar", titlebar.clone().upcast()),
373        }
374    }
375
376    /// The transient parent of the window.
377    pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
378        Self {
379            builder: self
380                .builder
381                .property("transient-for", transient_for.clone().upcast()),
382        }
383    }
384
385    /// Whether the widget or any of its descendents can accept
386    /// the input focus.
387    ///
388    /// This property is meant to be set by widget implementations,
389    /// typically in their instance init function.
390    pub fn can_focus(self, can_focus: bool) -> Self {
391        Self {
392            builder: self.builder.property("can-focus", can_focus),
393        }
394    }
395
396    /// Whether the widget can receive pointer events.
397    pub fn can_target(self, can_target: bool) -> Self {
398        Self {
399            builder: self.builder.property("can-target", can_target),
400        }
401    }
402
403    /// A list of css classes applied to this widget.
404    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
405        Self {
406            builder: self.builder.property("css-classes", css_classes.into()),
407        }
408    }
409
410    /// The name of this widget in the CSS tree.
411    ///
412    /// This property is meant to be set by widget implementations,
413    /// typically in their instance init function.
414    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
415        Self {
416            builder: self.builder.property("css-name", css_name.into()),
417        }
418    }
419
420    /// The cursor used by @widget.
421    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
422        Self {
423            builder: self.builder.property("cursor", cursor.clone()),
424        }
425    }
426
427    /// Whether the widget should grab focus when it is clicked with the mouse.
428    ///
429    /// This property is only relevant for widgets that can take focus.
430    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
431        Self {
432            builder: self.builder.property("focus-on-click", focus_on_click),
433        }
434    }
435
436    /// Whether this widget itself will accept the input focus.
437    pub fn focusable(self, focusable: bool) -> Self {
438        Self {
439            builder: self.builder.property("focusable", focusable),
440        }
441    }
442
443    /// How to distribute horizontal space if widget gets extra space.
444    pub fn halign(self, halign: Align) -> Self {
445        Self {
446            builder: self.builder.property("halign", halign),
447        }
448    }
449
450    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
451    /// signal on @widget.
452    ///
453    /// A true value indicates that @widget can have a tooltip, in this case
454    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
455    /// determine whether it will provide a tooltip or not.
456    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
457        Self {
458            builder: self.builder.property("has-tooltip", has_tooltip),
459        }
460    }
461
462    /// Overrides for height request of the widget.
463    ///
464    /// If this is -1, the natural request will be used.
465    pub fn height_request(self, height_request: i32) -> Self {
466        Self {
467            builder: self.builder.property("height-request", height_request),
468        }
469    }
470
471    /// Whether to expand horizontally.
472    pub fn hexpand(self, hexpand: bool) -> Self {
473        Self {
474            builder: self.builder.property("hexpand", hexpand),
475        }
476    }
477
478    /// Whether to use the `hexpand` property.
479    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
480        Self {
481            builder: self.builder.property("hexpand-set", hexpand_set),
482        }
483    }
484
485    /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
486    /// the preferred size of the widget, and allocate its children.
487    ///
488    /// This property is meant to be set by widget implementations,
489    /// typically in their instance init function.
490    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
491        Self {
492            builder: self
493                .builder
494                .property("layout-manager", layout_manager.clone().upcast()),
495        }
496    }
497
498    /// Makes this widget act like a modal dialog, with respect to
499    /// event delivery.
500    ///
501    /// Global event controllers will not handle events with targets
502    /// inside the widget, unless they are set up to ignore propagation
503    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
504    #[cfg(feature = "v4_18")]
505    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
506    pub fn limit_events(self, limit_events: bool) -> Self {
507        Self {
508            builder: self.builder.property("limit-events", limit_events),
509        }
510    }
511
512    /// Margin on bottom side of widget.
513    ///
514    /// This property adds margin outside of the widget's normal size
515    /// request, the margin will be added in addition to the size from
516    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
517    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
518        Self {
519            builder: self.builder.property("margin-bottom", margin_bottom),
520        }
521    }
522
523    /// Margin on end of widget, horizontally.
524    ///
525    /// This property supports left-to-right and right-to-left text
526    /// directions.
527    ///
528    /// This property adds margin outside of the widget's normal size
529    /// request, the margin will be added in addition to the size from
530    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
531    pub fn margin_end(self, margin_end: i32) -> Self {
532        Self {
533            builder: self.builder.property("margin-end", margin_end),
534        }
535    }
536
537    /// Margin on start of widget, horizontally.
538    ///
539    /// This property supports left-to-right and right-to-left text
540    /// directions.
541    ///
542    /// This property adds margin outside of the widget's normal size
543    /// request, the margin will be added in addition to the size from
544    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
545    pub fn margin_start(self, margin_start: i32) -> Self {
546        Self {
547            builder: self.builder.property("margin-start", margin_start),
548        }
549    }
550
551    /// Margin on top side of widget.
552    ///
553    /// This property adds margin outside of the widget's normal size
554    /// request, the margin will be added in addition to the size from
555    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
556    pub fn margin_top(self, margin_top: i32) -> Self {
557        Self {
558            builder: self.builder.property("margin-top", margin_top),
559        }
560    }
561
562    /// The name of the widget.
563    pub fn name(self, name: impl Into<glib::GString>) -> Self {
564        Self {
565            builder: self.builder.property("name", name.into()),
566        }
567    }
568
569    /// The requested opacity of the widget.
570    pub fn opacity(self, opacity: f64) -> Self {
571        Self {
572            builder: self.builder.property("opacity", opacity),
573        }
574    }
575
576    /// How content outside the widget's content area is treated.
577    ///
578    /// This property is meant to be set by widget implementations,
579    /// typically in their instance init function.
580    pub fn overflow(self, overflow: Overflow) -> Self {
581        Self {
582            builder: self.builder.property("overflow", overflow),
583        }
584    }
585
586    /// Whether the widget will receive the default action when it is focused.
587    pub fn receives_default(self, receives_default: bool) -> Self {
588        Self {
589            builder: self.builder.property("receives-default", receives_default),
590        }
591    }
592
593    /// Whether the widget responds to input.
594    pub fn sensitive(self, sensitive: bool) -> Self {
595        Self {
596            builder: self.builder.property("sensitive", sensitive),
597        }
598    }
599
600    /// Sets the text of tooltip to be the given string, which is marked up
601    /// with Pango markup.
602    ///
603    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
604    ///
605    /// This is a convenience property which will take care of getting the
606    /// tooltip shown if the given string is not `NULL`:
607    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
608    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
609    /// the default signal handler.
610    ///
611    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
612    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
613    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
614        Self {
615            builder: self
616                .builder
617                .property("tooltip-markup", tooltip_markup.into()),
618        }
619    }
620
621    /// Sets the text of tooltip to be the given string.
622    ///
623    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
624    ///
625    /// This is a convenience property which will take care of getting the
626    /// tooltip shown if the given string is not `NULL`:
627    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
628    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
629    /// the default signal handler.
630    ///
631    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
632    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
633    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
634        Self {
635            builder: self.builder.property("tooltip-text", tooltip_text.into()),
636        }
637    }
638
639    /// How to distribute vertical space if widget gets extra space.
640    pub fn valign(self, valign: Align) -> Self {
641        Self {
642            builder: self.builder.property("valign", valign),
643        }
644    }
645
646    /// Whether to expand vertically.
647    pub fn vexpand(self, vexpand: bool) -> Self {
648        Self {
649            builder: self.builder.property("vexpand", vexpand),
650        }
651    }
652
653    /// Whether to use the `vexpand` property.
654    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
655        Self {
656            builder: self.builder.property("vexpand-set", vexpand_set),
657        }
658    }
659
660    /// Whether the widget is visible.
661    pub fn visible(self, visible: bool) -> Self {
662        Self {
663            builder: self.builder.property("visible", visible),
664        }
665    }
666
667    /// Overrides for width request of the widget.
668    ///
669    /// If this is -1, the natural request will be used.
670    pub fn width_request(self, width_request: i32) -> Self {
671        Self {
672            builder: self.builder.property("width-request", width_request),
673        }
674    }
675
676    /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
677    ///
678    /// The accessible role cannot be changed once set.
679    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
680        Self {
681            builder: self.builder.property("accessible-role", accessible_role),
682        }
683    }
684
685    // rustdoc-stripper-ignore-next
686    /// Build the [`PageSetupUnixDialog`].
687    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
688    pub fn build(self) -> PageSetupUnixDialog {
689        assert_initialized_main_thread!();
690        self.builder.build()
691    }
692}