Skip to main content

gtk/auto/
message_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    Align, Application, Bin, Buildable, ButtonsType, Container, Dialog, MessageType, ResizeMode,
7    Widget, Window, WindowPosition, WindowType, ffi,
8};
9use glib::{
10    prelude::*,
11    signal::{SignalHandlerId, connect_raw},
12    translate::*,
13};
14use std::boxed::Box as Box_;
15
16glib::wrapper! {
17    /// [`MessageDialog`][crate::MessageDialog] presents a dialog with some message text. It’s simply a
18    /// convenience widget; you could construct the equivalent of [`MessageDialog`][crate::MessageDialog]
19    /// from [`Dialog`][crate::Dialog] without too much effort, but [`MessageDialog`][crate::MessageDialog] saves typing.
20    ///
21    /// One difference from [`Dialog`][crate::Dialog] is that [`MessageDialog`][crate::MessageDialog] sets the
22    /// [`skip-taskbar-hint`][struct@crate::Window#skip-taskbar-hint] property to [`true`], so that the dialog is hidden
23    /// from the taskbar by default.
24    ///
25    /// The easiest way to do a modal message dialog is to use [`DialogExt::run()`][crate::prelude::DialogExt::run()], though
26    /// you can also pass in the [`DialogFlags::MODAL`][crate::DialogFlags::MODAL] flag, [`DialogExt::run()`][crate::prelude::DialogExt::run()] automatically
27    /// makes the dialog modal and waits for the user to respond to it. [`DialogExt::run()`][crate::prelude::DialogExt::run()]
28    /// returns when any dialog button is clicked.
29    ///
30    /// An example for using a modal dialog:
31    ///
32    ///
33    /// **⚠️ The following code is in C ⚠️**
34    ///
35    /// ```C
36    ///  GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT;
37    ///  dialog = gtk_message_dialog_new (parent_window,
38    ///                                   flags,
39    ///                                   GTK_MESSAGE_ERROR,
40    ///                                   GTK_BUTTONS_CLOSE,
41    ///                                   "Error reading “%s”: %s",
42    ///                                   filename,
43    ///                                   g_strerror (errno));
44    ///  gtk_dialog_run (GTK_DIALOG (dialog));
45    ///  gtk_widget_destroy (dialog);
46    /// ```
47    ///
48    /// You might do a non-modal [`MessageDialog`][crate::MessageDialog] as follows:
49    ///
50    /// An example for a non-modal dialog:
51    ///
52    ///
53    /// **⚠️ The following code is in C ⚠️**
54    ///
55    /// ```C
56    ///  GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT;
57    ///  dialog = gtk_message_dialog_new (parent_window,
58    ///                                   flags,
59    ///                                   GTK_MESSAGE_ERROR,
60    ///                                   GTK_BUTTONS_CLOSE,
61    ///                                   "Error reading “%s”: %s",
62    ///                                   filename,
63    ///                                   g_strerror (errno));
64    ///
65    ///  // Destroy the dialog when the user responds to it
66    ///  // (e.g. clicks a button)
67    ///
68    ///  g_signal_connect_swapped (dialog, "response",
69    ///                            G_CALLBACK (gtk_widget_destroy),
70    ///                            dialog);
71    /// ```
72    ///
73    /// # GtkMessageDialog as GtkBuildable
74    ///
75    /// The GtkMessageDialog implementation of the GtkBuildable interface exposes
76    /// the message area as an internal child with the name “message_area”.
77    ///
78    /// ## Properties
79    ///
80    ///
81    /// #### `buttons`
82    ///  Writable | Construct Only
83    ///
84    ///
85    /// #### `image`
86    ///  The image for this dialog.
87    ///
88    /// Readable | Writable
89    ///
90    ///
91    /// #### `message-area`
92    ///  The [`Box`][crate::Box] that corresponds to the message area of this dialog. See
93    /// [`MessageDialogExt::message_area()`][crate::prelude::MessageDialogExt::message_area()] for a detailed description of this
94    /// area.
95    ///
96    /// Readable
97    ///
98    ///
99    /// #### `message-type`
100    ///  The type of the message.
101    ///
102    /// Readable | Writable | Construct
103    ///
104    ///
105    /// #### `secondary-text`
106    ///  The secondary text of the message dialog.
107    ///
108    /// Readable | Writable
109    ///
110    ///
111    /// #### `secondary-use-markup`
112    ///  [`true`] if the secondary text of the dialog includes Pango markup.
113    /// See `pango_parse_markup()`.
114    ///
115    /// Readable | Writable
116    ///
117    ///
118    /// #### `text`
119    ///  The primary text of the message dialog. If the dialog has
120    /// a secondary text, this will appear as the title.
121    ///
122    /// Readable | Writable
123    ///
124    ///
125    /// #### `use-markup`
126    ///  [`true`] if the primary text of the dialog includes Pango markup.
127    /// See `pango_parse_markup()`.
128    ///
129    /// Readable | Writable
130    /// <details><summary><h4>Dialog</h4></summary>
131    ///
132    ///
133    /// #### `use-header-bar`
134    ///  [`true`] if the dialog uses a [`HeaderBar`][crate::HeaderBar] for action buttons
135    /// instead of the action-area.
136    ///
137    /// For technical reasons, this property is declared as an integer
138    /// property, but you should only set it to [`true`] or [`false`].
139    ///
140    /// Readable | Writable | Construct Only
141    /// </details>
142    /// <details><summary><h4>Window</h4></summary>
143    ///
144    ///
145    /// #### `accept-focus`
146    ///  Whether the window should receive the input focus.
147    ///
148    /// Readable | Writable
149    ///
150    ///
151    /// #### `application`
152    ///  The [`Application`][crate::Application] associated with the window.
153    ///
154    /// The application will be kept alive for at least as long as it
155    /// has any windows associated with it (see [`ApplicationExtManual::hold()`][crate::gio::prelude::ApplicationExtManual::hold()]
156    /// for a way to keep it alive without windows).
157    ///
158    /// Normally, the connection between the application and the window
159    /// will remain until the window is destroyed, but you can explicitly
160    /// remove it by setting the :application property to [`None`].
161    ///
162    /// Readable | Writable
163    ///
164    ///
165    /// #### `attached-to`
166    ///  The widget to which this window is attached.
167    /// See [`GtkWindowExt::set_attached_to()`][crate::prelude::GtkWindowExt::set_attached_to()].
168    ///
169    /// Examples of places where specifying this relation is useful are
170    /// for instance a [`Menu`][crate::Menu] created by a [`ComboBox`][crate::ComboBox], a completion
171    /// popup window created by [`Entry`][crate::Entry] or a typeahead search entry
172    /// created by [`TreeView`][crate::TreeView].
173    ///
174    /// Readable | Writable | Construct
175    ///
176    ///
177    /// #### `decorated`
178    ///  Whether the window should be decorated by the window manager.
179    ///
180    /// Readable | Writable
181    ///
182    ///
183    /// #### `default-height`
184    ///  Readable | Writable
185    ///
186    ///
187    /// #### `default-width`
188    ///  Readable | Writable
189    ///
190    ///
191    /// #### `deletable`
192    ///  Whether the window frame should have a close button.
193    ///
194    /// Readable | Writable
195    ///
196    ///
197    /// #### `destroy-with-parent`
198    ///  Readable | Writable
199    ///
200    ///
201    /// #### `focus-on-map`
202    ///  Whether the window should receive the input focus when mapped.
203    ///
204    /// Readable | Writable
205    ///
206    ///
207    /// #### `focus-visible`
208    ///  Whether 'focus rectangles' are currently visible in this window.
209    ///
210    /// This property is maintained by GTK+ based on user input
211    /// and should not be set by applications.
212    ///
213    /// Readable | Writable
214    ///
215    ///
216    /// #### `gravity`
217    ///  The window gravity of the window. See [`GtkWindowExt::move_()`][crate::prelude::GtkWindowExt::move_()] and [`gdk::Gravity`][crate::gdk::Gravity] for
218    /// more details about window gravity.
219    ///
220    /// Readable | Writable
221    ///
222    ///
223    /// #### `has-resize-grip`
224    ///  Whether the window has a corner resize grip.
225    ///
226    /// Note that the resize grip is only shown if the window is
227    /// actually resizable and not maximized. Use
228    /// [`resize-grip-visible`][struct@crate::Window#resize-grip-visible] to find out if the resize
229    /// grip is currently shown.
230    ///
231    /// Readable | Writable
232    ///
233    ///
234    /// #### `has-toplevel-focus`
235    ///  Readable
236    ///
237    ///
238    /// #### `hide-titlebar-when-maximized`
239    ///  Whether the titlebar should be hidden during maximization.
240    ///
241    /// Readable | Writable
242    ///
243    ///
244    /// #### `icon`
245    ///  Readable | Writable
246    ///
247    ///
248    /// #### `icon-name`
249    ///  The :icon-name property specifies the name of the themed icon to
250    /// use as the window icon. See [`IconTheme`][crate::IconTheme] for more details.
251    ///
252    /// Readable | Writable
253    ///
254    ///
255    /// #### `is-active`
256    ///  Readable
257    ///
258    ///
259    /// #### `is-maximized`
260    ///  Readable
261    ///
262    ///
263    /// #### `mnemonics-visible`
264    ///  Whether mnemonics are currently visible in this window.
265    ///
266    /// This property is maintained by GTK+ based on user input,
267    /// and should not be set by applications.
268    ///
269    /// Readable | Writable
270    ///
271    ///
272    /// #### `modal`
273    ///  Readable | Writable
274    ///
275    ///
276    /// #### `resizable`
277    ///  Readable | Writable
278    ///
279    ///
280    /// #### `resize-grip-visible`
281    ///  Whether a corner resize grip is currently shown.
282    ///
283    /// Readable
284    ///
285    ///
286    /// #### `role`
287    ///  Readable | Writable
288    ///
289    ///
290    /// #### `screen`
291    ///  Readable | Writable
292    ///
293    ///
294    /// #### `skip-pager-hint`
295    ///  Readable | Writable
296    ///
297    ///
298    /// #### `skip-taskbar-hint`
299    ///  Readable | Writable
300    ///
301    ///
302    /// #### `startup-id`
303    ///  The :startup-id is a write-only property for setting window's
304    /// startup notification identifier. See [`GtkWindowExt::set_startup_id()`][crate::prelude::GtkWindowExt::set_startup_id()]
305    /// for more details.
306    ///
307    /// Writable
308    ///
309    ///
310    /// #### `title`
311    ///  Readable | Writable
312    ///
313    ///
314    /// #### `transient-for`
315    ///  The transient parent of the window. See [`GtkWindowExt::set_transient_for()`][crate::prelude::GtkWindowExt::set_transient_for()] for
316    /// more details about transient windows.
317    ///
318    /// Readable | Writable | Construct
319    ///
320    ///
321    /// #### `type`
322    ///  Readable | Writable | Construct Only
323    ///
324    ///
325    /// #### `type-hint`
326    ///  Readable | Writable
327    ///
328    ///
329    /// #### `urgency-hint`
330    ///  Readable | Writable
331    ///
332    ///
333    /// #### `window-position`
334    ///  Readable | Writable
335    /// </details>
336    /// <details><summary><h4>Container</h4></summary>
337    ///
338    ///
339    /// #### `border-width`
340    ///  Readable | Writable
341    ///
342    ///
343    /// #### `child`
344    ///  Writable
345    ///
346    ///
347    /// #### `resize-mode`
348    ///  Readable | Writable
349    /// </details>
350    /// <details><summary><h4>Widget</h4></summary>
351    ///
352    ///
353    /// #### `app-paintable`
354    ///  Readable | Writable
355    ///
356    ///
357    /// #### `can-default`
358    ///  Readable | Writable
359    ///
360    ///
361    /// #### `can-focus`
362    ///  Readable | Writable
363    ///
364    ///
365    /// #### `composite-child`
366    ///  Readable
367    ///
368    ///
369    /// #### `double-buffered`
370    ///  Whether the widget is double buffered.
371    ///
372    /// Readable | Writable
373    ///
374    ///
375    /// #### `events`
376    ///  Readable | Writable
377    ///
378    ///
379    /// #### `expand`
380    ///  Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
381    ///
382    /// Readable | Writable
383    ///
384    ///
385    /// #### `focus-on-click`
386    ///  Whether the widget should grab focus when it is clicked with the mouse.
387    ///
388    /// This property is only relevant for widgets that can take focus.
389    ///
390    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
391    /// GtkComboBox) implemented this property individually.
392    ///
393    /// Readable | Writable
394    ///
395    ///
396    /// #### `halign`
397    ///  How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
398    ///
399    /// Readable | Writable
400    ///
401    ///
402    /// #### `has-default`
403    ///  Readable | Writable
404    ///
405    ///
406    /// #### `has-focus`
407    ///  Readable | Writable
408    ///
409    ///
410    /// #### `has-tooltip`
411    ///  Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
412    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
413    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
414    /// whether it will provide a tooltip or not.
415    ///
416    /// Note that setting this property to [`true`] for the first time will change
417    /// the event masks of the GdkWindows of this widget to include leave-notify
418    /// and motion-notify events. This cannot and will not be undone when the
419    /// property is set to [`false`] again.
420    ///
421    /// Readable | Writable
422    ///
423    ///
424    /// #### `height-request`
425    ///  Readable | Writable
426    ///
427    ///
428    /// #### `hexpand`
429    ///  Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
430    ///
431    /// Readable | Writable
432    ///
433    ///
434    /// #### `hexpand-set`
435    ///  Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
436    ///
437    /// Readable | Writable
438    ///
439    ///
440    /// #### `is-focus`
441    ///  Readable | Writable
442    ///
443    ///
444    /// #### `margin`
445    ///  Sets all four sides' margin at once. If read, returns max
446    /// margin on any side.
447    ///
448    /// Readable | Writable
449    ///
450    ///
451    /// #### `margin-bottom`
452    ///  Margin on bottom side of widget.
453    ///
454    /// This property adds margin outside of the widget's normal size
455    /// request, the margin will be added in addition to the size from
456    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
457    ///
458    /// Readable | Writable
459    ///
460    ///
461    /// #### `margin-end`
462    ///  Margin on end of widget, horizontally. This property supports
463    /// left-to-right and right-to-left text directions.
464    ///
465    /// This property adds margin outside of the widget's normal size
466    /// request, the margin will be added in addition to the size from
467    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
468    ///
469    /// Readable | Writable
470    ///
471    ///
472    /// #### `margin-left`
473    ///  Margin on left side of widget.
474    ///
475    /// This property adds margin outside of the widget's normal size
476    /// request, the margin will be added in addition to the size from
477    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
478    ///
479    /// Readable | Writable
480    ///
481    ///
482    /// #### `margin-right`
483    ///  Margin on right side of widget.
484    ///
485    /// This property adds margin outside of the widget's normal size
486    /// request, the margin will be added in addition to the size from
487    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
488    ///
489    /// Readable | Writable
490    ///
491    ///
492    /// #### `margin-start`
493    ///  Margin on start of widget, horizontally. This property supports
494    /// left-to-right and right-to-left text directions.
495    ///
496    /// This property adds margin outside of the widget's normal size
497    /// request, the margin will be added in addition to the size from
498    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
499    ///
500    /// Readable | Writable
501    ///
502    ///
503    /// #### `margin-top`
504    ///  Margin on top side of widget.
505    ///
506    /// This property adds margin outside of the widget's normal size
507    /// request, the margin will be added in addition to the size from
508    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
509    ///
510    /// Readable | Writable
511    ///
512    ///
513    /// #### `name`
514    ///  Readable | Writable
515    ///
516    ///
517    /// #### `no-show-all`
518    ///  Readable | Writable
519    ///
520    ///
521    /// #### `opacity`
522    ///  The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
523    /// more details about window opacity.
524    ///
525    /// Before 3.8 this was only available in GtkWindow
526    ///
527    /// Readable | Writable
528    ///
529    ///
530    /// #### `parent`
531    ///  Readable | Writable
532    ///
533    ///
534    /// #### `receives-default`
535    ///  Readable | Writable
536    ///
537    ///
538    /// #### `scale-factor`
539    ///  The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
540    /// more details about widget scaling.
541    ///
542    /// Readable
543    ///
544    ///
545    /// #### `sensitive`
546    ///  Readable | Writable
547    ///
548    ///
549    /// #### `style`
550    ///  The style of the widget, which contains information about how it will look (colors, etc).
551    ///
552    /// Readable | Writable
553    ///
554    ///
555    /// #### `tooltip-markup`
556    ///  Sets the text of tooltip to be the given string, which is marked up
557    /// with the [Pango text markup language][PangoMarkupFormat].
558    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
559    ///
560    /// This is a convenience property which will take care of getting the
561    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
562    /// will automatically be set to [`true`] and there will be taken care of
563    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
564    ///
565    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
566    /// are set, the last one wins.
567    ///
568    /// Readable | Writable
569    ///
570    ///
571    /// #### `tooltip-text`
572    ///  Sets the text of tooltip to be the given string.
573    ///
574    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
575    ///
576    /// This is a convenience property which will take care of getting the
577    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
578    /// will automatically be set to [`true`] and there will be taken care of
579    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
580    ///
581    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
582    /// are set, the last one wins.
583    ///
584    /// Readable | Writable
585    ///
586    ///
587    /// #### `valign`
588    ///  How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
589    ///
590    /// Readable | Writable
591    ///
592    ///
593    /// #### `vexpand`
594    ///  Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
595    ///
596    /// Readable | Writable
597    ///
598    ///
599    /// #### `vexpand-set`
600    ///  Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
601    ///
602    /// Readable | Writable
603    ///
604    ///
605    /// #### `visible`
606    ///  Readable | Writable
607    ///
608    ///
609    /// #### `width-request`
610    ///  Readable | Writable
611    ///
612    ///
613    /// #### `window`
614    ///  The widget's window if it is realized, [`None`] otherwise.
615    ///
616    /// Readable
617    /// </details>
618    ///
619    /// # Implements
620    ///
621    /// [`MessageDialogExt`][trait@crate::prelude::MessageDialogExt], [`DialogExt`][trait@crate::prelude::DialogExt], [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`BinExt`][trait@crate::prelude::BinExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`MessageDialogExtManual`][trait@crate::prelude::MessageDialogExtManual], [`DialogExtManual`][trait@crate::prelude::DialogExtManual], [`GtkWindowExtManual`][trait@crate::prelude::GtkWindowExtManual], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
622    #[doc(alias = "GtkMessageDialog")]
623    pub struct MessageDialog(Object<ffi::GtkMessageDialog, ffi::GtkMessageDialogClass>) @extends Dialog, Window, Bin, Container, Widget, @implements Buildable;
624
625    match fn {
626        type_ => || ffi::gtk_message_dialog_get_type(),
627    }
628}
629
630impl MessageDialog {
631    pub const NONE: Option<&'static MessageDialog> = None;
632
633    // rustdoc-stripper-ignore-next
634    /// Creates a new builder-pattern struct instance to construct [`MessageDialog`] objects.
635    ///
636    /// This method returns an instance of [`MessageDialogBuilder`](crate::builders::MessageDialogBuilder) which can be used to create [`MessageDialog`] objects.
637    pub fn builder() -> MessageDialogBuilder {
638        MessageDialogBuilder::new()
639    }
640}
641
642// rustdoc-stripper-ignore-next
643/// A [builder-pattern] type to construct [`MessageDialog`] objects.
644///
645/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
646#[must_use = "The builder must be built to be used"]
647pub struct MessageDialogBuilder {
648    builder: glib::object::ObjectBuilder<'static, MessageDialog>,
649}
650
651impl MessageDialogBuilder {
652    fn new() -> Self {
653        Self {
654            builder: glib::object::Object::builder(),
655        }
656    }
657
658    pub fn buttons(self, buttons: ButtonsType) -> Self {
659        Self {
660            builder: self.builder.property("buttons", buttons),
661        }
662    }
663
664    /// The type of the message.
665    pub fn message_type(self, message_type: MessageType) -> Self {
666        Self {
667            builder: self.builder.property("message-type", message_type),
668        }
669    }
670
671    /// The secondary text of the message dialog.
672    pub fn secondary_text(self, secondary_text: impl Into<glib::GString>) -> Self {
673        Self {
674            builder: self
675                .builder
676                .property("secondary-text", secondary_text.into()),
677        }
678    }
679
680    /// [`true`] if the secondary text of the dialog includes Pango markup.
681    /// See `pango_parse_markup()`.
682    pub fn secondary_use_markup(self, secondary_use_markup: bool) -> Self {
683        Self {
684            builder: self
685                .builder
686                .property("secondary-use-markup", secondary_use_markup),
687        }
688    }
689
690    /// The primary text of the message dialog. If the dialog has
691    /// a secondary text, this will appear as the title.
692    pub fn text(self, text: impl Into<glib::GString>) -> Self {
693        Self {
694            builder: self.builder.property("text", text.into()),
695        }
696    }
697
698    /// [`true`] if the primary text of the dialog includes Pango markup.
699    /// See `pango_parse_markup()`.
700    pub fn use_markup(self, use_markup: bool) -> Self {
701        Self {
702            builder: self.builder.property("use-markup", use_markup),
703        }
704    }
705
706    /// [`true`] if the dialog uses a [`HeaderBar`][crate::HeaderBar] for action buttons
707    /// instead of the action-area.
708    ///
709    /// For technical reasons, this property is declared as an integer
710    /// property, but you should only set it to [`true`] or [`false`].
711    pub fn use_header_bar(self, use_header_bar: i32) -> Self {
712        Self {
713            builder: self.builder.property("use-header-bar", use_header_bar),
714        }
715    }
716
717    /// Whether the window should receive the input focus.
718    pub fn accept_focus(self, accept_focus: bool) -> Self {
719        Self {
720            builder: self.builder.property("accept-focus", accept_focus),
721        }
722    }
723
724    /// The [`Application`][crate::Application] associated with the window.
725    ///
726    /// The application will be kept alive for at least as long as it
727    /// has any windows associated with it (see [`ApplicationExtManual::hold()`][crate::gio::prelude::ApplicationExtManual::hold()]
728    /// for a way to keep it alive without windows).
729    ///
730    /// Normally, the connection between the application and the window
731    /// will remain until the window is destroyed, but you can explicitly
732    /// remove it by setting the :application property to [`None`].
733    pub fn application(self, application: &impl IsA<Application>) -> Self {
734        Self {
735            builder: self
736                .builder
737                .property("application", application.clone().upcast()),
738        }
739    }
740
741    /// The widget to which this window is attached.
742    /// See [`GtkWindowExt::set_attached_to()`][crate::prelude::GtkWindowExt::set_attached_to()].
743    ///
744    /// Examples of places where specifying this relation is useful are
745    /// for instance a [`Menu`][crate::Menu] created by a [`ComboBox`][crate::ComboBox], a completion
746    /// popup window created by [`Entry`][crate::Entry] or a typeahead search entry
747    /// created by [`TreeView`][crate::TreeView].
748    pub fn attached_to(self, attached_to: &impl IsA<Widget>) -> Self {
749        Self {
750            builder: self
751                .builder
752                .property("attached-to", attached_to.clone().upcast()),
753        }
754    }
755
756    /// Whether the window should be decorated by the window manager.
757    pub fn decorated(self, decorated: bool) -> Self {
758        Self {
759            builder: self.builder.property("decorated", decorated),
760        }
761    }
762
763    pub fn default_height(self, default_height: i32) -> Self {
764        Self {
765            builder: self.builder.property("default-height", default_height),
766        }
767    }
768
769    pub fn default_width(self, default_width: i32) -> Self {
770        Self {
771            builder: self.builder.property("default-width", default_width),
772        }
773    }
774
775    /// Whether the window frame should have a close button.
776    pub fn deletable(self, deletable: bool) -> Self {
777        Self {
778            builder: self.builder.property("deletable", deletable),
779        }
780    }
781
782    pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
783        Self {
784            builder: self
785                .builder
786                .property("destroy-with-parent", destroy_with_parent),
787        }
788    }
789
790    /// Whether the window should receive the input focus when mapped.
791    pub fn focus_on_map(self, focus_on_map: bool) -> Self {
792        Self {
793            builder: self.builder.property("focus-on-map", focus_on_map),
794        }
795    }
796
797    /// Whether 'focus rectangles' are currently visible in this window.
798    ///
799    /// This property is maintained by GTK+ based on user input
800    /// and should not be set by applications.
801    pub fn focus_visible(self, focus_visible: bool) -> Self {
802        Self {
803            builder: self.builder.property("focus-visible", focus_visible),
804        }
805    }
806
807    /// The window gravity of the window. See [`GtkWindowExt::move_()`][crate::prelude::GtkWindowExt::move_()] and [`gdk::Gravity`][crate::gdk::Gravity] for
808    /// more details about window gravity.
809    pub fn gravity(self, gravity: gdk::Gravity) -> Self {
810        Self {
811            builder: self.builder.property("gravity", gravity),
812        }
813    }
814
815    /// Whether the titlebar should be hidden during maximization.
816    pub fn hide_titlebar_when_maximized(self, hide_titlebar_when_maximized: bool) -> Self {
817        Self {
818            builder: self
819                .builder
820                .property("hide-titlebar-when-maximized", hide_titlebar_when_maximized),
821        }
822    }
823
824    pub fn icon(self, icon: &gdk_pixbuf::Pixbuf) -> Self {
825        Self {
826            builder: self.builder.property("icon", icon.clone()),
827        }
828    }
829
830    /// The :icon-name property specifies the name of the themed icon to
831    /// use as the window icon. See [`IconTheme`][crate::IconTheme] for more details.
832    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
833        Self {
834            builder: self.builder.property("icon-name", icon_name.into()),
835        }
836    }
837
838    /// Whether mnemonics are currently visible in this window.
839    ///
840    /// This property is maintained by GTK+ based on user input,
841    /// and should not be set by applications.
842    pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
843        Self {
844            builder: self
845                .builder
846                .property("mnemonics-visible", mnemonics_visible),
847        }
848    }
849
850    pub fn modal(self, modal: bool) -> Self {
851        Self {
852            builder: self.builder.property("modal", modal),
853        }
854    }
855
856    pub fn resizable(self, resizable: bool) -> Self {
857        Self {
858            builder: self.builder.property("resizable", resizable),
859        }
860    }
861
862    pub fn role(self, role: impl Into<glib::GString>) -> Self {
863        Self {
864            builder: self.builder.property("role", role.into()),
865        }
866    }
867
868    pub fn screen(self, screen: &gdk::Screen) -> Self {
869        Self {
870            builder: self.builder.property("screen", screen.clone()),
871        }
872    }
873
874    pub fn skip_pager_hint(self, skip_pager_hint: bool) -> Self {
875        Self {
876            builder: self.builder.property("skip-pager-hint", skip_pager_hint),
877        }
878    }
879
880    pub fn skip_taskbar_hint(self, skip_taskbar_hint: bool) -> Self {
881        Self {
882            builder: self
883                .builder
884                .property("skip-taskbar-hint", skip_taskbar_hint),
885        }
886    }
887
888    /// The :startup-id is a write-only property for setting window's
889    /// startup notification identifier. See [`GtkWindowExt::set_startup_id()`][crate::prelude::GtkWindowExt::set_startup_id()]
890    /// for more details.
891    pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
892        Self {
893            builder: self.builder.property("startup-id", startup_id.into()),
894        }
895    }
896
897    pub fn title(self, title: impl Into<glib::GString>) -> Self {
898        Self {
899            builder: self.builder.property("title", title.into()),
900        }
901    }
902
903    /// The transient parent of the window. See [`GtkWindowExt::set_transient_for()`][crate::prelude::GtkWindowExt::set_transient_for()] for
904    /// more details about transient windows.
905    pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
906        Self {
907            builder: self
908                .builder
909                .property("transient-for", transient_for.clone().upcast()),
910        }
911    }
912
913    pub fn type_(self, type_: WindowType) -> Self {
914        Self {
915            builder: self.builder.property("type", type_),
916        }
917    }
918
919    pub fn type_hint(self, type_hint: gdk::WindowTypeHint) -> Self {
920        Self {
921            builder: self.builder.property("type-hint", type_hint),
922        }
923    }
924
925    pub fn urgency_hint(self, urgency_hint: bool) -> Self {
926        Self {
927            builder: self.builder.property("urgency-hint", urgency_hint),
928        }
929    }
930
931    pub fn window_position(self, window_position: WindowPosition) -> Self {
932        Self {
933            builder: self.builder.property("window-position", window_position),
934        }
935    }
936
937    pub fn border_width(self, border_width: u32) -> Self {
938        Self {
939            builder: self.builder.property("border-width", border_width),
940        }
941    }
942
943    pub fn child(self, child: &impl IsA<Widget>) -> Self {
944        Self {
945            builder: self.builder.property("child", child.clone().upcast()),
946        }
947    }
948
949    pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
950        Self {
951            builder: self.builder.property("resize-mode", resize_mode),
952        }
953    }
954
955    pub fn app_paintable(self, app_paintable: bool) -> Self {
956        Self {
957            builder: self.builder.property("app-paintable", app_paintable),
958        }
959    }
960
961    pub fn can_default(self, can_default: bool) -> Self {
962        Self {
963            builder: self.builder.property("can-default", can_default),
964        }
965    }
966
967    pub fn can_focus(self, can_focus: bool) -> Self {
968        Self {
969            builder: self.builder.property("can-focus", can_focus),
970        }
971    }
972
973    pub fn events(self, events: gdk::EventMask) -> Self {
974        Self {
975            builder: self.builder.property("events", events),
976        }
977    }
978
979    /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
980    pub fn expand(self, expand: bool) -> Self {
981        Self {
982            builder: self.builder.property("expand", expand),
983        }
984    }
985
986    /// Whether the widget should grab focus when it is clicked with the mouse.
987    ///
988    /// This property is only relevant for widgets that can take focus.
989    ///
990    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
991    /// GtkComboBox) implemented this property individually.
992    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
993        Self {
994            builder: self.builder.property("focus-on-click", focus_on_click),
995        }
996    }
997
998    /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
999    pub fn halign(self, halign: Align) -> Self {
1000        Self {
1001            builder: self.builder.property("halign", halign),
1002        }
1003    }
1004
1005    pub fn has_default(self, has_default: bool) -> Self {
1006        Self {
1007            builder: self.builder.property("has-default", has_default),
1008        }
1009    }
1010
1011    pub fn has_focus(self, has_focus: bool) -> Self {
1012        Self {
1013            builder: self.builder.property("has-focus", has_focus),
1014        }
1015    }
1016
1017    /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
1018    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
1019    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
1020    /// whether it will provide a tooltip or not.
1021    ///
1022    /// Note that setting this property to [`true`] for the first time will change
1023    /// the event masks of the GdkWindows of this widget to include leave-notify
1024    /// and motion-notify events. This cannot and will not be undone when the
1025    /// property is set to [`false`] again.
1026    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1027        Self {
1028            builder: self.builder.property("has-tooltip", has_tooltip),
1029        }
1030    }
1031
1032    pub fn height_request(self, height_request: i32) -> Self {
1033        Self {
1034            builder: self.builder.property("height-request", height_request),
1035        }
1036    }
1037
1038    /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
1039    pub fn hexpand(self, hexpand: bool) -> Self {
1040        Self {
1041            builder: self.builder.property("hexpand", hexpand),
1042        }
1043    }
1044
1045    /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
1046    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1047        Self {
1048            builder: self.builder.property("hexpand-set", hexpand_set),
1049        }
1050    }
1051
1052    pub fn is_focus(self, is_focus: bool) -> Self {
1053        Self {
1054            builder: self.builder.property("is-focus", is_focus),
1055        }
1056    }
1057
1058    /// Sets all four sides' margin at once. If read, returns max
1059    /// margin on any side.
1060    pub fn margin(self, margin: i32) -> Self {
1061        Self {
1062            builder: self.builder.property("margin", margin),
1063        }
1064    }
1065
1066    /// Margin on bottom side of widget.
1067    ///
1068    /// This property adds margin outside of the widget's normal size
1069    /// request, the margin will be added in addition to the size from
1070    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1071    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1072        Self {
1073            builder: self.builder.property("margin-bottom", margin_bottom),
1074        }
1075    }
1076
1077    /// Margin on end of widget, horizontally. This property supports
1078    /// left-to-right and right-to-left text directions.
1079    ///
1080    /// This property adds margin outside of the widget's normal size
1081    /// request, the margin will be added in addition to the size from
1082    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1083    pub fn margin_end(self, margin_end: i32) -> Self {
1084        Self {
1085            builder: self.builder.property("margin-end", margin_end),
1086        }
1087    }
1088
1089    /// Margin on start of widget, horizontally. This property supports
1090    /// left-to-right and right-to-left text directions.
1091    ///
1092    /// This property adds margin outside of the widget's normal size
1093    /// request, the margin will be added in addition to the size from
1094    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1095    pub fn margin_start(self, margin_start: i32) -> Self {
1096        Self {
1097            builder: self.builder.property("margin-start", margin_start),
1098        }
1099    }
1100
1101    /// Margin on top side of widget.
1102    ///
1103    /// This property adds margin outside of the widget's normal size
1104    /// request, the margin will be added in addition to the size from
1105    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1106    pub fn margin_top(self, margin_top: i32) -> Self {
1107        Self {
1108            builder: self.builder.property("margin-top", margin_top),
1109        }
1110    }
1111
1112    pub fn name(self, name: impl Into<glib::GString>) -> Self {
1113        Self {
1114            builder: self.builder.property("name", name.into()),
1115        }
1116    }
1117
1118    pub fn no_show_all(self, no_show_all: bool) -> Self {
1119        Self {
1120            builder: self.builder.property("no-show-all", no_show_all),
1121        }
1122    }
1123
1124    /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
1125    /// more details about window opacity.
1126    ///
1127    /// Before 3.8 this was only available in GtkWindow
1128    pub fn opacity(self, opacity: f64) -> Self {
1129        Self {
1130            builder: self.builder.property("opacity", opacity),
1131        }
1132    }
1133
1134    pub fn parent(self, parent: &impl IsA<Container>) -> Self {
1135        Self {
1136            builder: self.builder.property("parent", parent.clone().upcast()),
1137        }
1138    }
1139
1140    pub fn receives_default(self, receives_default: bool) -> Self {
1141        Self {
1142            builder: self.builder.property("receives-default", receives_default),
1143        }
1144    }
1145
1146    pub fn sensitive(self, sensitive: bool) -> Self {
1147        Self {
1148            builder: self.builder.property("sensitive", sensitive),
1149        }
1150    }
1151
1152    /// Sets the text of tooltip to be the given string, which is marked up
1153    /// with the [Pango text markup language][PangoMarkupFormat].
1154    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1155    ///
1156    /// This is a convenience property which will take care of getting the
1157    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1158    /// will automatically be set to [`true`] and there will be taken care of
1159    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1160    ///
1161    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1162    /// are set, the last one wins.
1163    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1164        Self {
1165            builder: self
1166                .builder
1167                .property("tooltip-markup", tooltip_markup.into()),
1168        }
1169    }
1170
1171    /// Sets the text of tooltip to be the given string.
1172    ///
1173    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1174    ///
1175    /// This is a convenience property which will take care of getting the
1176    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1177    /// will automatically be set to [`true`] and there will be taken care of
1178    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1179    ///
1180    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1181    /// are set, the last one wins.
1182    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1183        Self {
1184            builder: self.builder.property("tooltip-text", tooltip_text.into()),
1185        }
1186    }
1187
1188    /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
1189    pub fn valign(self, valign: Align) -> Self {
1190        Self {
1191            builder: self.builder.property("valign", valign),
1192        }
1193    }
1194
1195    /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
1196    pub fn vexpand(self, vexpand: bool) -> Self {
1197        Self {
1198            builder: self.builder.property("vexpand", vexpand),
1199        }
1200    }
1201
1202    /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
1203    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1204        Self {
1205            builder: self.builder.property("vexpand-set", vexpand_set),
1206        }
1207    }
1208
1209    pub fn visible(self, visible: bool) -> Self {
1210        Self {
1211            builder: self.builder.property("visible", visible),
1212        }
1213    }
1214
1215    pub fn width_request(self, width_request: i32) -> Self {
1216        Self {
1217            builder: self.builder.property("width-request", width_request),
1218        }
1219    }
1220
1221    // rustdoc-stripper-ignore-next
1222    /// Build the [`MessageDialog`].
1223    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1224    pub fn build(self) -> MessageDialog {
1225        assert_initialized_main_thread!();
1226        self.builder.build()
1227    }
1228}
1229
1230/// Trait containing all [`struct@MessageDialog`] methods.
1231///
1232/// # Implementors
1233///
1234/// [`MessageDialog`][struct@crate::MessageDialog]
1235pub trait MessageDialogExt: IsA<MessageDialog> + 'static {
1236    /// Returns the message area of the dialog. This is the box where the
1237    /// dialog’s primary and secondary labels are packed. You can add your
1238    /// own extra content to that box and it will appear below those labels.
1239    /// See [`DialogExt::content_area()`][crate::prelude::DialogExt::content_area()] for the corresponding
1240    /// function in the parent [`Dialog`][crate::Dialog].
1241    ///
1242    /// # Returns
1243    ///
1244    /// A [`Box`][crate::Box] corresponding to the
1245    ///  “message area” in the `self`.
1246    #[doc(alias = "gtk_message_dialog_get_message_area")]
1247    #[doc(alias = "get_message_area")]
1248    #[doc(alias = "message-area")]
1249    fn message_area(&self) -> Widget {
1250        unsafe {
1251            from_glib_none(ffi::gtk_message_dialog_get_message_area(
1252                self.as_ref().to_glib_none().0,
1253            ))
1254        }
1255    }
1256
1257    /// Sets the text of the message dialog to be `str`, which is marked
1258    /// up with the [Pango text markup language][PangoMarkupFormat].
1259    /// ## `str`
1260    /// markup string (see [Pango markup format][PangoMarkupFormat])
1261    #[doc(alias = "gtk_message_dialog_set_markup")]
1262    fn set_markup(&self, str: &str) {
1263        unsafe {
1264            ffi::gtk_message_dialog_set_markup(
1265                self.as_ref().to_glib_none().0,
1266                str.to_glib_none().0,
1267            );
1268        }
1269    }
1270
1271    /// The type of the message.
1272    #[doc(alias = "message-type")]
1273    fn message_type(&self) -> MessageType {
1274        ObjectExt::property(self.as_ref(), "message-type")
1275    }
1276
1277    /// The type of the message.
1278    #[doc(alias = "message-type")]
1279    fn set_message_type(&self, message_type: MessageType) {
1280        ObjectExt::set_property(self.as_ref(), "message-type", message_type)
1281    }
1282
1283    /// The secondary text of the message dialog.
1284    #[doc(alias = "secondary-text")]
1285    fn secondary_text(&self) -> Option<glib::GString> {
1286        ObjectExt::property(self.as_ref(), "secondary-text")
1287    }
1288
1289    /// The secondary text of the message dialog.
1290    #[doc(alias = "secondary-text")]
1291    fn set_secondary_text(&self, secondary_text: Option<&str>) {
1292        ObjectExt::set_property(self.as_ref(), "secondary-text", secondary_text)
1293    }
1294
1295    /// [`true`] if the secondary text of the dialog includes Pango markup.
1296    /// See `pango_parse_markup()`.
1297    #[doc(alias = "secondary-use-markup")]
1298    fn is_secondary_use_markup(&self) -> bool {
1299        ObjectExt::property(self.as_ref(), "secondary-use-markup")
1300    }
1301
1302    /// [`true`] if the secondary text of the dialog includes Pango markup.
1303    /// See `pango_parse_markup()`.
1304    #[doc(alias = "secondary-use-markup")]
1305    fn set_secondary_use_markup(&self, secondary_use_markup: bool) {
1306        ObjectExt::set_property(self.as_ref(), "secondary-use-markup", secondary_use_markup)
1307    }
1308
1309    /// The primary text of the message dialog. If the dialog has
1310    /// a secondary text, this will appear as the title.
1311    fn text(&self) -> Option<glib::GString> {
1312        ObjectExt::property(self.as_ref(), "text")
1313    }
1314
1315    /// The primary text of the message dialog. If the dialog has
1316    /// a secondary text, this will appear as the title.
1317    fn set_text(&self, text: Option<&str>) {
1318        ObjectExt::set_property(self.as_ref(), "text", text)
1319    }
1320
1321    /// [`true`] if the primary text of the dialog includes Pango markup.
1322    /// See `pango_parse_markup()`.
1323    #[doc(alias = "use-markup")]
1324    fn uses_markup(&self) -> bool {
1325        ObjectExt::property(self.as_ref(), "use-markup")
1326    }
1327
1328    /// [`true`] if the primary text of the dialog includes Pango markup.
1329    /// See `pango_parse_markup()`.
1330    #[doc(alias = "use-markup")]
1331    fn set_use_markup(&self, use_markup: bool) {
1332        ObjectExt::set_property(self.as_ref(), "use-markup", use_markup)
1333    }
1334
1335    #[doc(alias = "message-area")]
1336    fn connect_message_area_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1337        unsafe extern "C" fn notify_message_area_trampoline<
1338            P: IsA<MessageDialog>,
1339            F: Fn(&P) + 'static,
1340        >(
1341            this: *mut ffi::GtkMessageDialog,
1342            _param_spec: glib::ffi::gpointer,
1343            f: glib::ffi::gpointer,
1344        ) {
1345            unsafe {
1346                let f: &F = &*(f as *const F);
1347                f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1348            }
1349        }
1350        unsafe {
1351            let f: Box_<F> = Box_::new(f);
1352            connect_raw(
1353                self.as_ptr() as *mut _,
1354                c"notify::message-area".as_ptr(),
1355                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1356                    notify_message_area_trampoline::<Self, F> as *const (),
1357                )),
1358                Box_::into_raw(f),
1359            )
1360        }
1361    }
1362
1363    #[doc(alias = "message-type")]
1364    fn connect_message_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1365        unsafe extern "C" fn notify_message_type_trampoline<
1366            P: IsA<MessageDialog>,
1367            F: Fn(&P) + 'static,
1368        >(
1369            this: *mut ffi::GtkMessageDialog,
1370            _param_spec: glib::ffi::gpointer,
1371            f: glib::ffi::gpointer,
1372        ) {
1373            unsafe {
1374                let f: &F = &*(f as *const F);
1375                f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1376            }
1377        }
1378        unsafe {
1379            let f: Box_<F> = Box_::new(f);
1380            connect_raw(
1381                self.as_ptr() as *mut _,
1382                c"notify::message-type".as_ptr(),
1383                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1384                    notify_message_type_trampoline::<Self, F> as *const (),
1385                )),
1386                Box_::into_raw(f),
1387            )
1388        }
1389    }
1390
1391    #[doc(alias = "secondary-text")]
1392    fn connect_secondary_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1393        unsafe extern "C" fn notify_secondary_text_trampoline<
1394            P: IsA<MessageDialog>,
1395            F: Fn(&P) + 'static,
1396        >(
1397            this: *mut ffi::GtkMessageDialog,
1398            _param_spec: glib::ffi::gpointer,
1399            f: glib::ffi::gpointer,
1400        ) {
1401            unsafe {
1402                let f: &F = &*(f as *const F);
1403                f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1404            }
1405        }
1406        unsafe {
1407            let f: Box_<F> = Box_::new(f);
1408            connect_raw(
1409                self.as_ptr() as *mut _,
1410                c"notify::secondary-text".as_ptr(),
1411                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1412                    notify_secondary_text_trampoline::<Self, F> as *const (),
1413                )),
1414                Box_::into_raw(f),
1415            )
1416        }
1417    }
1418
1419    #[doc(alias = "secondary-use-markup")]
1420    fn connect_secondary_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1421        unsafe extern "C" fn notify_secondary_use_markup_trampoline<
1422            P: IsA<MessageDialog>,
1423            F: Fn(&P) + 'static,
1424        >(
1425            this: *mut ffi::GtkMessageDialog,
1426            _param_spec: glib::ffi::gpointer,
1427            f: glib::ffi::gpointer,
1428        ) {
1429            unsafe {
1430                let f: &F = &*(f as *const F);
1431                f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1432            }
1433        }
1434        unsafe {
1435            let f: Box_<F> = Box_::new(f);
1436            connect_raw(
1437                self.as_ptr() as *mut _,
1438                c"notify::secondary-use-markup".as_ptr(),
1439                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1440                    notify_secondary_use_markup_trampoline::<Self, F> as *const (),
1441                )),
1442                Box_::into_raw(f),
1443            )
1444        }
1445    }
1446
1447    #[doc(alias = "text")]
1448    fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1449        unsafe extern "C" fn notify_text_trampoline<P: IsA<MessageDialog>, F: Fn(&P) + 'static>(
1450            this: *mut ffi::GtkMessageDialog,
1451            _param_spec: glib::ffi::gpointer,
1452            f: glib::ffi::gpointer,
1453        ) {
1454            unsafe {
1455                let f: &F = &*(f as *const F);
1456                f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1457            }
1458        }
1459        unsafe {
1460            let f: Box_<F> = Box_::new(f);
1461            connect_raw(
1462                self.as_ptr() as *mut _,
1463                c"notify::text".as_ptr(),
1464                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1465                    notify_text_trampoline::<Self, F> as *const (),
1466                )),
1467                Box_::into_raw(f),
1468            )
1469        }
1470    }
1471
1472    #[doc(alias = "use-markup")]
1473    fn connect_use_markup_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1474        unsafe extern "C" fn notify_use_markup_trampoline<
1475            P: IsA<MessageDialog>,
1476            F: Fn(&P) + 'static,
1477        >(
1478            this: *mut ffi::GtkMessageDialog,
1479            _param_spec: glib::ffi::gpointer,
1480            f: glib::ffi::gpointer,
1481        ) {
1482            unsafe {
1483                let f: &F = &*(f as *const F);
1484                f(MessageDialog::from_glib_borrow(this).unsafe_cast_ref())
1485            }
1486        }
1487        unsafe {
1488            let f: Box_<F> = Box_::new(f);
1489            connect_raw(
1490                self.as_ptr() as *mut _,
1491                c"notify::use-markup".as_ptr(),
1492                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1493                    notify_use_markup_trampoline::<Self, F> as *const (),
1494                )),
1495                Box_::into_raw(f),
1496            )
1497        }
1498    }
1499}
1500
1501impl<O: IsA<MessageDialog>> MessageDialogExt for O {}