gtk4/auto/app_chooser_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#![allow(deprecated)]
5
6#[cfg(feature = "v4_10")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
8use crate::Accessible;
9use crate::{
10 AppChooser, Buildable, ConstraintTarget, Dialog, DialogFlags, Native, Root, ShortcutManager,
11 Widget, Window, ffi,
12};
13use glib::{
14 prelude::*,
15 signal::{SignalHandlerId, connect_raw},
16 translate::*,
17};
18use std::boxed::Box as Box_;
19
20#[cfg(feature = "v4_10")]
21#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
22glib::wrapper! {
23 /// The application selection widgets should be
24 /// implemented according to the design of each platform and/or
25 /// application requiring them.
26 ///
27 ///
28 /// Note that [`AppChooserDialog`][crate::AppChooserDialog] does not have any interesting methods
29 /// of its own. Instead, you should get the embedded [`AppChooserWidget`][crate::AppChooserWidget]
30 /// using [`widget()`][Self::widget()] and call its methods if
31 /// the generic [`AppChooser`][crate::AppChooser] interface is not sufficient for
32 /// your needs.
33 ///
34 /// To set the heading that is shown above the [`AppChooserWidget`][crate::AppChooserWidget],
35 /// use [`set_heading()`][Self::set_heading()].
36 ///
37 /// ## CSS nodes
38 ///
39 /// [`AppChooserDialog`][crate::AppChooserDialog] has a single CSS node with the name `window` and style
40 /// class `.appchooser`.
41 ///
42 /// ## Properties
43 ///
44 ///
45 /// #### `gfile`
46 /// The GFile used by the [`AppChooserDialog`][crate::AppChooserDialog].
47 ///
48 /// The dialog's [`AppChooserWidget`][crate::AppChooserWidget] content type will
49 /// be guessed from the file, if present.
50 ///
51 /// Readable | Writable | Construct Only
52 ///
53 ///
54 /// #### `heading`
55 /// The text to show at the top of the dialog.
56 ///
57 /// The string may contain Pango markup.
58 ///
59 /// Readable | Writable
60 /// <details><summary><h4>Dialog</h4></summary>
61 ///
62 ///
63 /// #### `use-header-bar`
64 /// header, NULL);
65 /// dialog = g_object_new (GTK_TYPE_DIALOG, header, TRUE, NULL);
66 /// ```text
67 ///
68 ///
69 /// Readable | Writable | Construct Only
70 /// </details>
71 /// <details><summary><h4>Window</h4></summary>
72 ///
73 ///
74 /// #### `application`
75 /// The [`Application`][crate::Application] associated with the window.
76 ///
77 /// The application will be kept alive for at least as long as it
78 /// has any windows associated with it (see g_application_hold()
79 /// for a way to keep it alive without windows).
80 ///
81 /// Normally, the connection between the application and the window
82 /// will remain until the window is destroyed, but you can explicitly
83 /// remove it by setting the this property to `NULL`.
84 ///
85 /// Readable | Writable
86 ///
87 ///
88 /// #### `child`
89 /// The child widget.
90 ///
91 /// Readable | Writable
92 ///
93 ///
94 /// #### `decorated`
95 /// Whether the window should have a frame (also known as *decorations*).
96 ///
97 /// Readable | Writable
98 ///
99 ///
100 /// #### `default-height`
101 /// The default height of the window.
102 ///
103 /// Readable | Writable
104 ///
105 ///
106 /// #### `default-widget`
107 /// The default widget.
108 ///
109 /// Readable | Writable
110 ///
111 ///
112 /// #### `default-width`
113 /// The default width of the window.
114 ///
115 /// Readable | Writable
116 ///
117 ///
118 /// #### `deletable`
119 /// Whether the window frame should have a close button.
120 ///
121 /// Readable | Writable
122 ///
123 ///
124 /// #### `destroy-with-parent`
125 /// If this window should be destroyed when the parent is destroyed.
126 ///
127 /// Readable | Writable
128 ///
129 ///
130 /// #### `display`
131 /// The display that will display this window.
132 ///
133 /// Readable | Writable
134 ///
135 ///
136 /// #### `focus-visible`
137 /// Whether 'focus rectangles' are currently visible in this window.
138 ///
139 /// This property is maintained by GTK based on user input
140 /// and should not be set by applications.
141 ///
142 /// Readable | Writable
143 ///
144 ///
145 /// #### `focus-widget`
146 /// The focus widget.
147 ///
148 /// Readable | Writable
149 ///
150 ///
151 /// #### `fullscreened`
152 /// Whether the window is fullscreen.
153 ///
154 /// Setting this property is the equivalent of calling
155 /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
156 /// either operation is asynchronous, which means you will need to
157 /// connect to the ::notify signal in order to know whether the
158 /// operation was successful.
159 ///
160 /// Readable | Writable
161 ///
162 ///
163 /// #### `gravity`
164 /// The gravity to use when resizing the window programmatically.
165 ///
166 /// Gravity describes which point of the window we want to keep
167 /// fixed (meaning that the window will grow in the opposite direction).
168 /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
169 /// want the to fix top right corner of the window.
170 ///
171 /// Readable | Writable
172 ///
173 ///
174 /// #### `handle-menubar-accel`
175 /// for activating
176 /// menubars.
177 ///
178 /// Readable | Writable
179 ///
180 ///
181 /// #### `hide-on-close`
182 /// If this window should be hidden instead of destroyed when the user clicks
183 /// the close button.
184 ///
185 /// Readable | Writable
186 ///
187 ///
188 /// #### `icon-name`
189 /// Specifies the name of the themed icon to use as the window icon.
190 ///
191 /// See [`IconTheme`][crate::IconTheme] for more details.
192 ///
193 /// Readable | Writable
194 ///
195 ///
196 /// #### `is-active`
197 /// Whether the toplevel is the currently active window.
198 ///
199 /// Readable
200 ///
201 ///
202 /// #### `maximized`
203 /// Whether the window is maximized.
204 ///
205 /// Setting this property is the equivalent of calling
206 /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
207 /// either operation is asynchronous, which means you will need to
208 /// connect to the ::notify signal in order to know whether the
209 /// operation was successful.
210 ///
211 /// Readable | Writable
212 ///
213 ///
214 /// #### `mnemonics-visible`
215 /// Whether mnemonics are currently visible in this window.
216 ///
217 /// This property is maintained by GTK based on user input,
218 /// and should not be set by applications.
219 ///
220 /// Readable | Writable
221 ///
222 ///
223 /// #### `modal`
224 /// If true, the window is modal.
225 ///
226 /// Readable | Writable
227 ///
228 ///
229 /// #### `resizable`
230 /// If true, users can resize the window.
231 ///
232 /// Readable | Writable
233 ///
234 ///
235 /// #### `startup-id`
236 /// A write-only property for setting window's startup notification identifier.
237 ///
238 /// Writable
239 ///
240 ///
241 /// #### `suspended`
242 /// Whether the window is suspended.
243 ///
244 /// See [`GtkWindowExt::is_suspended()`][crate::prelude::GtkWindowExt::is_suspended()] for details about what suspended means.
245 ///
246 /// Readable
247 ///
248 ///
249 /// #### `title`
250 /// The title of the window.
251 ///
252 /// Readable | Writable
253 ///
254 ///
255 /// #### `titlebar`
256 /// The titlebar widget.
257 ///
258 /// Readable | Writable
259 ///
260 ///
261 /// #### `transient-for`
262 /// The transient parent of the window.
263 ///
264 /// Readable | Writable | Construct
265 /// </details>
266 /// <details><summary><h4>Widget</h4></summary>
267 ///
268 ///
269 /// #### `can-focus`
270 /// Whether the widget or any of its descendents can accept
271 /// the input focus.
272 ///
273 /// This property is meant to be set by widget implementations,
274 /// typically in their instance init function.
275 ///
276 /// Readable | Writable
277 ///
278 ///
279 /// #### `can-target`
280 /// Whether the widget can receive pointer events.
281 ///
282 /// Readable | Writable
283 ///
284 ///
285 /// #### `css-classes`
286 /// A list of css classes applied to this widget.
287 ///
288 /// Readable | Writable
289 ///
290 ///
291 /// #### `css-name`
292 /// The name of this widget in the CSS tree.
293 ///
294 /// This property is meant to be set by widget implementations,
295 /// typically in their instance init function.
296 ///
297 /// Readable | Writable | Construct Only
298 ///
299 ///
300 /// #### `cursor`
301 /// The cursor used by @widget.
302 ///
303 /// Readable | Writable
304 ///
305 ///
306 /// #### `focus-on-click`
307 /// Whether the widget should grab focus when it is clicked with the mouse.
308 ///
309 /// This property is only relevant for widgets that can take focus.
310 ///
311 /// Readable | Writable
312 ///
313 ///
314 /// #### `focusable`
315 /// Whether this widget itself will accept the input focus.
316 ///
317 /// Readable | Writable
318 ///
319 ///
320 /// #### `halign`
321 /// How to distribute horizontal space if widget gets extra space.
322 ///
323 /// Readable | Writable
324 ///
325 ///
326 /// #### `has-default`
327 /// Whether the widget is the default widget.
328 ///
329 /// Readable
330 ///
331 ///
332 /// #### `has-focus`
333 /// Whether the widget has the input focus.
334 ///
335 /// Readable
336 ///
337 ///
338 /// #### `has-tooltip`
339 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
340 /// signal on @widget.
341 ///
342 /// A true value indicates that @widget can have a tooltip, in this case
343 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
344 /// determine whether it will provide a tooltip or not.
345 ///
346 /// Readable | Writable
347 ///
348 ///
349 /// #### `height-request`
350 /// Overrides for height request of the widget.
351 ///
352 /// If this is -1, the natural request will be used.
353 ///
354 /// Readable | Writable
355 ///
356 ///
357 /// #### `hexpand`
358 /// Whether to expand horizontally.
359 ///
360 /// Readable | Writable
361 ///
362 ///
363 /// #### `hexpand-set`
364 /// Whether to use the `hexpand` property.
365 ///
366 /// Readable | Writable
367 ///
368 ///
369 /// #### `layout-manager`
370 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
371 /// the preferred size of the widget, and allocate its children.
372 ///
373 /// This property is meant to be set by widget implementations,
374 /// typically in their instance init function.
375 ///
376 /// Readable | Writable
377 ///
378 ///
379 /// #### `limit-events`
380 /// Makes this widget act like a modal dialog, with respect to
381 /// event delivery.
382 ///
383 /// Global event controllers will not handle events with targets
384 /// inside the widget, unless they are set up to ignore propagation
385 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
386 ///
387 /// Readable | Writable
388 ///
389 ///
390 /// #### `margin-bottom`
391 /// Margin on bottom side of widget.
392 ///
393 /// This property adds margin outside of the widget's normal size
394 /// request, the margin will be added in addition to the size from
395 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
396 ///
397 /// Readable | Writable
398 ///
399 ///
400 /// #### `margin-end`
401 /// Margin on end of widget, horizontally.
402 ///
403 /// This property supports left-to-right and right-to-left text
404 /// directions.
405 ///
406 /// This property adds margin outside of the widget's normal size
407 /// request, the margin will be added in addition to the size from
408 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
409 ///
410 /// Readable | Writable
411 ///
412 ///
413 /// #### `margin-start`
414 /// Margin on start of widget, horizontally.
415 ///
416 /// This property supports left-to-right and right-to-left text
417 /// directions.
418 ///
419 /// This property adds margin outside of the widget's normal size
420 /// request, the margin will be added in addition to the size from
421 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
422 ///
423 /// Readable | Writable
424 ///
425 ///
426 /// #### `margin-top`
427 /// Margin on top side of widget.
428 ///
429 /// This property adds margin outside of the widget's normal size
430 /// request, the margin will be added in addition to the size from
431 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
432 ///
433 /// Readable | Writable
434 ///
435 ///
436 /// #### `name`
437 /// The name of the widget.
438 ///
439 /// Readable | Writable
440 ///
441 ///
442 /// #### `opacity`
443 /// The requested opacity of the widget.
444 ///
445 /// Readable | Writable
446 ///
447 ///
448 /// #### `overflow`
449 /// How content outside the widget's content area is treated.
450 ///
451 /// This property is meant to be set by widget implementations,
452 /// typically in their instance init function.
453 ///
454 /// Readable | Writable
455 ///
456 ///
457 /// #### `parent`
458 /// The parent widget of this widget.
459 ///
460 /// Readable
461 ///
462 ///
463 /// #### `receives-default`
464 /// Whether the widget will receive the default action when it is focused.
465 ///
466 /// Readable | Writable
467 ///
468 ///
469 /// #### `root`
470 /// The [`Root`][crate::Root] widget of the widget tree containing this widget.
471 ///
472 /// This will be `NULL` if the widget is not contained in a root widget.
473 ///
474 /// Readable
475 ///
476 ///
477 /// #### `scale-factor`
478 /// The scale factor of the widget.
479 ///
480 /// Readable
481 ///
482 ///
483 /// #### `sensitive`
484 /// Whether the widget responds to input.
485 ///
486 /// Readable | Writable
487 ///
488 ///
489 /// #### `tooltip-markup`
490 /// Sets the text of tooltip to be the given string, which is marked up
491 /// with Pango markup.
492 ///
493 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
494 ///
495 /// This is a convenience property which will take care of getting the
496 /// tooltip shown if the given string is not `NULL`:
497 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
498 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
499 /// the default signal handler.
500 ///
501 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
502 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
503 ///
504 /// Readable | Writable
505 ///
506 ///
507 /// #### `tooltip-text`
508 /// Sets the text of tooltip to be the given string.
509 ///
510 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
511 ///
512 /// This is a convenience property which will take care of getting the
513 /// tooltip shown if the given string is not `NULL`:
514 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
515 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
516 /// the default signal handler.
517 ///
518 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
519 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
520 ///
521 /// Readable | Writable
522 ///
523 ///
524 /// #### `valign`
525 /// How to distribute vertical space if widget gets extra space.
526 ///
527 /// Readable | Writable
528 ///
529 ///
530 /// #### `vexpand`
531 /// Whether to expand vertically.
532 ///
533 /// Readable | Writable
534 ///
535 ///
536 /// #### `vexpand-set`
537 /// Whether to use the `vexpand` property.
538 ///
539 /// Readable | Writable
540 ///
541 ///
542 /// #### `visible`
543 /// Whether the widget is visible.
544 ///
545 /// Readable | Writable
546 ///
547 ///
548 /// #### `width-request`
549 /// Overrides for width request of the widget.
550 ///
551 /// If this is -1, the natural request will be used.
552 ///
553 /// Readable | Writable
554 /// </details>
555 /// <details><summary><h4>Accessible</h4></summary>
556 ///
557 ///
558 /// #### `accessible-role`
559 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
560 ///
561 /// The accessible role cannot be changed once set.
562 ///
563 /// Readable | Writable
564 /// </details>
565 /// <details><summary><h4>AppChooser</h4></summary>
566 ///
567 ///
568 /// #### `content-type`
569 /// The content type of the [`AppChooser`][crate::AppChooser] object.
570 ///
571 /// See `GContentType` for more information about content types.
572 ///
573 /// Readable | Writable | Construct Only
574 /// </details>
575 ///
576 /// # Implements
577 ///
578 /// [`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], [`AppChooserExt`][trait@crate::prelude::AppChooserExt], [`DialogExtManual`][trait@crate::prelude::DialogExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
579 #[doc(alias = "GtkAppChooserDialog")]
580 pub struct AppChooserDialog(Object<ffi::GtkAppChooserDialog>) @extends Dialog, Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager, AppChooser;
581
582 match fn {
583 type_ => || ffi::gtk_app_chooser_dialog_get_type(),
584 }
585}
586
587#[cfg(not(feature = "v4_10"))]
588glib::wrapper! {
589 #[doc(alias = "GtkAppChooserDialog")]
590 pub struct AppChooserDialog(Object<ffi::GtkAppChooserDialog>) @extends Dialog, Window, Widget, @implements Buildable, ConstraintTarget, Native, Root, ShortcutManager, AppChooser;
591
592 match fn {
593 type_ => || ffi::gtk_app_chooser_dialog_get_type(),
594 }
595}
596
597impl AppChooserDialog {
598 /// Creates a new [`AppChooserDialog`][crate::AppChooserDialog] for the provided `GFile`.
599 ///
600 /// The dialog will show applications that can open the file.
601 ///
602 /// # Deprecated since 4.10
603 ///
604 /// This widget will be removed in GTK 5
605 /// ## `parent`
606 /// a [`Window`][crate::Window]
607 /// ## `flags`
608 /// flags for this dialog
609 /// ## `file`
610 /// a `GFile`
611 ///
612 /// # Returns
613 ///
614 /// a newly created [`AppChooserDialog`][crate::AppChooserDialog]
615 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
616 #[allow(deprecated)]
617 #[doc(alias = "gtk_app_chooser_dialog_new")]
618 pub fn new(
619 parent: Option<&impl IsA<Window>>,
620 flags: DialogFlags,
621 file: &impl IsA<gio::File>,
622 ) -> AppChooserDialog {
623 assert_initialized_main_thread!();
624 unsafe {
625 Widget::from_glib_none(ffi::gtk_app_chooser_dialog_new(
626 parent.map(|p| p.as_ref()).to_glib_none().0,
627 flags.into_glib(),
628 file.as_ref().to_glib_none().0,
629 ))
630 .unsafe_cast()
631 }
632 }
633
634 /// Creates a new [`AppChooserDialog`][crate::AppChooserDialog] for the provided content type.
635 ///
636 /// The dialog will show applications that can open the content type.
637 ///
638 /// # Deprecated since 4.10
639 ///
640 /// This widget will be removed in GTK 5
641 /// ## `parent`
642 /// a [`Window`][crate::Window]
643 /// ## `flags`
644 /// flags for this dialog
645 /// ## `content_type`
646 /// a content type string
647 ///
648 /// # Returns
649 ///
650 /// a newly created [`AppChooserDialog`][crate::AppChooserDialog]
651 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
652 #[allow(deprecated)]
653 #[doc(alias = "gtk_app_chooser_dialog_new_for_content_type")]
654 #[doc(alias = "new_for_content_type")]
655 pub fn for_content_type(
656 parent: Option<&impl IsA<Window>>,
657 flags: DialogFlags,
658 content_type: &str,
659 ) -> AppChooserDialog {
660 assert_initialized_main_thread!();
661 unsafe {
662 Widget::from_glib_none(ffi::gtk_app_chooser_dialog_new_for_content_type(
663 parent.map(|p| p.as_ref()).to_glib_none().0,
664 flags.into_glib(),
665 content_type.to_glib_none().0,
666 ))
667 .unsafe_cast()
668 }
669 }
670
671 /// Returns the text to display at the top of the dialog.
672 ///
673 /// # Deprecated since 4.10
674 ///
675 /// This widget will be removed in GTK 5
676 ///
677 /// # Returns
678 ///
679 /// the text to display at the top of the dialog,
680 /// or [`None`], in which case a default text is displayed
681 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
682 #[allow(deprecated)]
683 #[doc(alias = "gtk_app_chooser_dialog_get_heading")]
684 #[doc(alias = "get_heading")]
685 pub fn heading(&self) -> Option<glib::GString> {
686 unsafe {
687 from_glib_none(ffi::gtk_app_chooser_dialog_get_heading(
688 self.to_glib_none().0,
689 ))
690 }
691 }
692
693 /// Returns the [`AppChooserWidget`][crate::AppChooserWidget] of this dialog.
694 ///
695 /// # Deprecated since 4.10
696 ///
697 /// This widget will be removed in GTK 5
698 ///
699 /// # Returns
700 ///
701 /// the [`AppChooserWidget`][crate::AppChooserWidget] of @self
702 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
703 #[allow(deprecated)]
704 #[doc(alias = "gtk_app_chooser_dialog_get_widget")]
705 #[doc(alias = "get_widget")]
706 pub fn widget(&self) -> Widget {
707 unsafe {
708 from_glib_none(ffi::gtk_app_chooser_dialog_get_widget(
709 self.to_glib_none().0,
710 ))
711 }
712 }
713
714 /// Sets the text to display at the top of the dialog.
715 ///
716 /// If the heading is not set, the dialog displays a default text.
717 ///
718 /// # Deprecated since 4.10
719 ///
720 /// This widget will be removed in GTK 5
721 /// ## `heading`
722 /// a string containing Pango markup
723 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
724 #[allow(deprecated)]
725 #[doc(alias = "gtk_app_chooser_dialog_set_heading")]
726 #[doc(alias = "heading")]
727 pub fn set_heading(&self, heading: &str) {
728 unsafe {
729 ffi::gtk_app_chooser_dialog_set_heading(
730 self.to_glib_none().0,
731 heading.to_glib_none().0,
732 );
733 }
734 }
735
736 /// The GFile used by the [`AppChooserDialog`][crate::AppChooserDialog].
737 ///
738 /// The dialog's [`AppChooserWidget`][crate::AppChooserWidget] content type will
739 /// be guessed from the file, if present.
740 pub fn gfile(&self) -> Option<gio::File> {
741 ObjectExt::property(self, "gfile")
742 }
743
744 #[doc(alias = "heading")]
745 pub fn connect_heading_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
746 unsafe extern "C" fn notify_heading_trampoline<F: Fn(&AppChooserDialog) + 'static>(
747 this: *mut ffi::GtkAppChooserDialog,
748 _param_spec: glib::ffi::gpointer,
749 f: glib::ffi::gpointer,
750 ) {
751 unsafe {
752 let f: &F = &*(f as *const F);
753 f(&from_glib_borrow(this))
754 }
755 }
756 unsafe {
757 let f: Box_<F> = Box_::new(f);
758 connect_raw(
759 self.as_ptr() as *mut _,
760 c"notify::heading".as_ptr(),
761 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
762 notify_heading_trampoline::<F> as *const (),
763 )),
764 Box_::into_raw(f),
765 )
766 }
767 }
768}