gtk/auto/spinner.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::{Align, Buildable, Container, Widget, ffi};
6use glib::{
7 prelude::*,
8 signal::{SignalHandlerId, connect_raw},
9 translate::*,
10};
11use std::boxed::Box as Box_;
12
13glib::wrapper! {
14 /// A GtkSpinner widget displays an icon-size spinning animation.
15 /// It is often used as an alternative to a [`ProgressBar`][crate::ProgressBar] for
16 /// displaying indefinite activity, instead of actual progress.
17 ///
18 /// To start the animation, use [`SpinnerExt::start()`][crate::prelude::SpinnerExt::start()], to stop it
19 /// use [`SpinnerExt::stop()`][crate::prelude::SpinnerExt::stop()].
20 ///
21 /// # CSS nodes
22 ///
23 /// GtkSpinner has a single CSS node with the name spinner. When the animation is
24 /// active, the :checked pseudoclass is added to this node.
25 ///
26 /// ## Properties
27 ///
28 ///
29 /// #### `active`
30 /// Readable | Writable
31 /// <details><summary><h4>Widget</h4></summary>
32 ///
33 ///
34 /// #### `app-paintable`
35 /// Readable | Writable
36 ///
37 ///
38 /// #### `can-default`
39 /// Readable | Writable
40 ///
41 ///
42 /// #### `can-focus`
43 /// Readable | Writable
44 ///
45 ///
46 /// #### `composite-child`
47 /// Readable
48 ///
49 ///
50 /// #### `double-buffered`
51 /// Whether the widget is double buffered.
52 ///
53 /// Readable | Writable
54 ///
55 ///
56 /// #### `events`
57 /// Readable | Writable
58 ///
59 ///
60 /// #### `expand`
61 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
62 ///
63 /// Readable | Writable
64 ///
65 ///
66 /// #### `focus-on-click`
67 /// Whether the widget should grab focus when it is clicked with the mouse.
68 ///
69 /// This property is only relevant for widgets that can take focus.
70 ///
71 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
72 /// GtkComboBox) implemented this property individually.
73 ///
74 /// Readable | Writable
75 ///
76 ///
77 /// #### `halign`
78 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
79 ///
80 /// Readable | Writable
81 ///
82 ///
83 /// #### `has-default`
84 /// Readable | Writable
85 ///
86 ///
87 /// #### `has-focus`
88 /// Readable | Writable
89 ///
90 ///
91 /// #### `has-tooltip`
92 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
93 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
94 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
95 /// whether it will provide a tooltip or not.
96 ///
97 /// Note that setting this property to [`true`] for the first time will change
98 /// the event masks of the GdkWindows of this widget to include leave-notify
99 /// and motion-notify events. This cannot and will not be undone when the
100 /// property is set to [`false`] again.
101 ///
102 /// Readable | Writable
103 ///
104 ///
105 /// #### `height-request`
106 /// Readable | Writable
107 ///
108 ///
109 /// #### `hexpand`
110 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
111 ///
112 /// Readable | Writable
113 ///
114 ///
115 /// #### `hexpand-set`
116 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
117 ///
118 /// Readable | Writable
119 ///
120 ///
121 /// #### `is-focus`
122 /// Readable | Writable
123 ///
124 ///
125 /// #### `margin`
126 /// Sets all four sides' margin at once. If read, returns max
127 /// margin on any side.
128 ///
129 /// Readable | Writable
130 ///
131 ///
132 /// #### `margin-bottom`
133 /// Margin on bottom side of widget.
134 ///
135 /// This property adds margin outside of the widget's normal size
136 /// request, the margin will be added in addition to the size from
137 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
138 ///
139 /// Readable | Writable
140 ///
141 ///
142 /// #### `margin-end`
143 /// Margin on end of widget, horizontally. This property supports
144 /// left-to-right and right-to-left text directions.
145 ///
146 /// This property adds margin outside of the widget's normal size
147 /// request, the margin will be added in addition to the size from
148 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
149 ///
150 /// Readable | Writable
151 ///
152 ///
153 /// #### `margin-left`
154 /// Margin on left side of widget.
155 ///
156 /// This property adds margin outside of the widget's normal size
157 /// request, the margin will be added in addition to the size from
158 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
159 ///
160 /// Readable | Writable
161 ///
162 ///
163 /// #### `margin-right`
164 /// Margin on right side of widget.
165 ///
166 /// This property adds margin outside of the widget's normal size
167 /// request, the margin will be added in addition to the size from
168 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
169 ///
170 /// Readable | Writable
171 ///
172 ///
173 /// #### `margin-start`
174 /// Margin on start of widget, horizontally. This property supports
175 /// left-to-right and right-to-left text directions.
176 ///
177 /// This property adds margin outside of the widget's normal size
178 /// request, the margin will be added in addition to the size from
179 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
180 ///
181 /// Readable | Writable
182 ///
183 ///
184 /// #### `margin-top`
185 /// Margin on top side of widget.
186 ///
187 /// This property adds margin outside of the widget's normal size
188 /// request, the margin will be added in addition to the size from
189 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
190 ///
191 /// Readable | Writable
192 ///
193 ///
194 /// #### `name`
195 /// Readable | Writable
196 ///
197 ///
198 /// #### `no-show-all`
199 /// Readable | Writable
200 ///
201 ///
202 /// #### `opacity`
203 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
204 /// more details about window opacity.
205 ///
206 /// Before 3.8 this was only available in GtkWindow
207 ///
208 /// Readable | Writable
209 ///
210 ///
211 /// #### `parent`
212 /// Readable | Writable
213 ///
214 ///
215 /// #### `receives-default`
216 /// Readable | Writable
217 ///
218 ///
219 /// #### `scale-factor`
220 /// The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
221 /// more details about widget scaling.
222 ///
223 /// Readable
224 ///
225 ///
226 /// #### `sensitive`
227 /// Readable | Writable
228 ///
229 ///
230 /// #### `style`
231 /// The style of the widget, which contains information about how it will look (colors, etc).
232 ///
233 /// Readable | Writable
234 ///
235 ///
236 /// #### `tooltip-markup`
237 /// Sets the text of tooltip to be the given string, which is marked up
238 /// with the [Pango text markup language][PangoMarkupFormat].
239 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
240 ///
241 /// This is a convenience property which will take care of getting the
242 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
243 /// will automatically be set to [`true`] and there will be taken care of
244 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
245 ///
246 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
247 /// are set, the last one wins.
248 ///
249 /// Readable | Writable
250 ///
251 ///
252 /// #### `tooltip-text`
253 /// Sets the text of tooltip to be the given string.
254 ///
255 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
256 ///
257 /// This is a convenience property which will take care of getting the
258 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
259 /// will automatically be set to [`true`] and there will be taken care of
260 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
261 ///
262 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
263 /// are set, the last one wins.
264 ///
265 /// Readable | Writable
266 ///
267 ///
268 /// #### `valign`
269 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
270 ///
271 /// Readable | Writable
272 ///
273 ///
274 /// #### `vexpand`
275 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
276 ///
277 /// Readable | Writable
278 ///
279 ///
280 /// #### `vexpand-set`
281 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
282 ///
283 /// Readable | Writable
284 ///
285 ///
286 /// #### `visible`
287 /// Readable | Writable
288 ///
289 ///
290 /// #### `width-request`
291 /// Readable | Writable
292 ///
293 ///
294 /// #### `window`
295 /// The widget's window if it is realized, [`None`] otherwise.
296 ///
297 /// Readable
298 /// </details>
299 ///
300 /// # Implements
301 ///
302 /// [`SpinnerExt`][trait@crate::prelude::SpinnerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
303 #[doc(alias = "GtkSpinner")]
304 pub struct Spinner(Object<ffi::GtkSpinner, ffi::GtkSpinnerClass>) @extends Widget, @implements Buildable;
305
306 match fn {
307 type_ => || ffi::gtk_spinner_get_type(),
308 }
309}
310
311impl Spinner {
312 pub const NONE: Option<&'static Spinner> = None;
313
314 /// Returns a new spinner widget. Not yet started.
315 ///
316 /// # Returns
317 ///
318 /// a new [`Spinner`][crate::Spinner]
319 #[doc(alias = "gtk_spinner_new")]
320 pub fn new() -> Spinner {
321 assert_initialized_main_thread!();
322 unsafe { Widget::from_glib_none(ffi::gtk_spinner_new()).unsafe_cast() }
323 }
324
325 // rustdoc-stripper-ignore-next
326 /// Creates a new builder-pattern struct instance to construct [`Spinner`] objects.
327 ///
328 /// This method returns an instance of [`SpinnerBuilder`](crate::builders::SpinnerBuilder) which can be used to create [`Spinner`] objects.
329 pub fn builder() -> SpinnerBuilder {
330 SpinnerBuilder::new()
331 }
332}
333
334impl Default for Spinner {
335 fn default() -> Self {
336 Self::new()
337 }
338}
339
340// rustdoc-stripper-ignore-next
341/// A [builder-pattern] type to construct [`Spinner`] objects.
342///
343/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
344#[must_use = "The builder must be built to be used"]
345pub struct SpinnerBuilder {
346 builder: glib::object::ObjectBuilder<'static, Spinner>,
347}
348
349impl SpinnerBuilder {
350 fn new() -> Self {
351 Self {
352 builder: glib::object::Object::builder(),
353 }
354 }
355
356 pub fn active(self, active: bool) -> Self {
357 Self {
358 builder: self.builder.property("active", active),
359 }
360 }
361
362 pub fn app_paintable(self, app_paintable: bool) -> Self {
363 Self {
364 builder: self.builder.property("app-paintable", app_paintable),
365 }
366 }
367
368 pub fn can_default(self, can_default: bool) -> Self {
369 Self {
370 builder: self.builder.property("can-default", can_default),
371 }
372 }
373
374 pub fn can_focus(self, can_focus: bool) -> Self {
375 Self {
376 builder: self.builder.property("can-focus", can_focus),
377 }
378 }
379
380 pub fn events(self, events: gdk::EventMask) -> Self {
381 Self {
382 builder: self.builder.property("events", events),
383 }
384 }
385
386 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
387 pub fn expand(self, expand: bool) -> Self {
388 Self {
389 builder: self.builder.property("expand", expand),
390 }
391 }
392
393 /// Whether the widget should grab focus when it is clicked with the mouse.
394 ///
395 /// This property is only relevant for widgets that can take focus.
396 ///
397 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
398 /// GtkComboBox) implemented this property individually.
399 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
400 Self {
401 builder: self.builder.property("focus-on-click", focus_on_click),
402 }
403 }
404
405 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
406 pub fn halign(self, halign: Align) -> Self {
407 Self {
408 builder: self.builder.property("halign", halign),
409 }
410 }
411
412 pub fn has_default(self, has_default: bool) -> Self {
413 Self {
414 builder: self.builder.property("has-default", has_default),
415 }
416 }
417
418 pub fn has_focus(self, has_focus: bool) -> Self {
419 Self {
420 builder: self.builder.property("has-focus", has_focus),
421 }
422 }
423
424 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
425 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
426 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
427 /// whether it will provide a tooltip or not.
428 ///
429 /// Note that setting this property to [`true`] for the first time will change
430 /// the event masks of the GdkWindows of this widget to include leave-notify
431 /// and motion-notify events. This cannot and will not be undone when the
432 /// property is set to [`false`] again.
433 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
434 Self {
435 builder: self.builder.property("has-tooltip", has_tooltip),
436 }
437 }
438
439 pub fn height_request(self, height_request: i32) -> Self {
440 Self {
441 builder: self.builder.property("height-request", height_request),
442 }
443 }
444
445 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
446 pub fn hexpand(self, hexpand: bool) -> Self {
447 Self {
448 builder: self.builder.property("hexpand", hexpand),
449 }
450 }
451
452 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
453 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
454 Self {
455 builder: self.builder.property("hexpand-set", hexpand_set),
456 }
457 }
458
459 pub fn is_focus(self, is_focus: bool) -> Self {
460 Self {
461 builder: self.builder.property("is-focus", is_focus),
462 }
463 }
464
465 /// Sets all four sides' margin at once. If read, returns max
466 /// margin on any side.
467 pub fn margin(self, margin: i32) -> Self {
468 Self {
469 builder: self.builder.property("margin", margin),
470 }
471 }
472
473 /// Margin on bottom 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 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
479 Self {
480 builder: self.builder.property("margin-bottom", margin_bottom),
481 }
482 }
483
484 /// Margin on end of widget, horizontally. This property supports
485 /// left-to-right and right-to-left text directions.
486 ///
487 /// This property adds margin outside of the widget's normal size
488 /// request, the margin will be added in addition to the size from
489 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
490 pub fn margin_end(self, margin_end: i32) -> Self {
491 Self {
492 builder: self.builder.property("margin-end", margin_end),
493 }
494 }
495
496 /// Margin on start of widget, horizontally. This property supports
497 /// left-to-right and right-to-left text directions.
498 ///
499 /// This property adds margin outside of the widget's normal size
500 /// request, the margin will be added in addition to the size from
501 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
502 pub fn margin_start(self, margin_start: i32) -> Self {
503 Self {
504 builder: self.builder.property("margin-start", margin_start),
505 }
506 }
507
508 /// Margin on top side of widget.
509 ///
510 /// This property adds margin outside of the widget's normal size
511 /// request, the margin will be added in addition to the size from
512 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
513 pub fn margin_top(self, margin_top: i32) -> Self {
514 Self {
515 builder: self.builder.property("margin-top", margin_top),
516 }
517 }
518
519 pub fn name(self, name: impl Into<glib::GString>) -> Self {
520 Self {
521 builder: self.builder.property("name", name.into()),
522 }
523 }
524
525 pub fn no_show_all(self, no_show_all: bool) -> Self {
526 Self {
527 builder: self.builder.property("no-show-all", no_show_all),
528 }
529 }
530
531 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
532 /// more details about window opacity.
533 ///
534 /// Before 3.8 this was only available in GtkWindow
535 pub fn opacity(self, opacity: f64) -> Self {
536 Self {
537 builder: self.builder.property("opacity", opacity),
538 }
539 }
540
541 pub fn parent(self, parent: &impl IsA<Container>) -> Self {
542 Self {
543 builder: self.builder.property("parent", parent.clone().upcast()),
544 }
545 }
546
547 pub fn receives_default(self, receives_default: bool) -> Self {
548 Self {
549 builder: self.builder.property("receives-default", receives_default),
550 }
551 }
552
553 pub fn sensitive(self, sensitive: bool) -> Self {
554 Self {
555 builder: self.builder.property("sensitive", sensitive),
556 }
557 }
558
559 /// Sets the text of tooltip to be the given string, which is marked up
560 /// with the [Pango text markup language][PangoMarkupFormat].
561 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
562 ///
563 /// This is a convenience property which will take care of getting the
564 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
565 /// will automatically be set to [`true`] and there will be taken care of
566 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
567 ///
568 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
569 /// are set, the last one wins.
570 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
571 Self {
572 builder: self
573 .builder
574 .property("tooltip-markup", tooltip_markup.into()),
575 }
576 }
577
578 /// Sets the text of tooltip to be the given string.
579 ///
580 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
581 ///
582 /// This is a convenience property which will take care of getting the
583 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
584 /// will automatically be set to [`true`] and there will be taken care of
585 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
586 ///
587 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
588 /// are set, the last one wins.
589 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
590 Self {
591 builder: self.builder.property("tooltip-text", tooltip_text.into()),
592 }
593 }
594
595 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
596 pub fn valign(self, valign: Align) -> Self {
597 Self {
598 builder: self.builder.property("valign", valign),
599 }
600 }
601
602 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
603 pub fn vexpand(self, vexpand: bool) -> Self {
604 Self {
605 builder: self.builder.property("vexpand", vexpand),
606 }
607 }
608
609 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
610 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
611 Self {
612 builder: self.builder.property("vexpand-set", vexpand_set),
613 }
614 }
615
616 pub fn visible(self, visible: bool) -> Self {
617 Self {
618 builder: self.builder.property("visible", visible),
619 }
620 }
621
622 pub fn width_request(self, width_request: i32) -> Self {
623 Self {
624 builder: self.builder.property("width-request", width_request),
625 }
626 }
627
628 // rustdoc-stripper-ignore-next
629 /// Build the [`Spinner`].
630 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
631 pub fn build(self) -> Spinner {
632 assert_initialized_main_thread!();
633 self.builder.build()
634 }
635}
636
637/// Trait containing all [`struct@Spinner`] methods.
638///
639/// # Implementors
640///
641/// [`Spinner`][struct@crate::Spinner]
642pub trait SpinnerExt: IsA<Spinner> + 'static {
643 /// Starts the animation of the spinner.
644 #[doc(alias = "gtk_spinner_start")]
645 fn start(&self) {
646 unsafe {
647 ffi::gtk_spinner_start(self.as_ref().to_glib_none().0);
648 }
649 }
650
651 /// Stops the animation of the spinner.
652 #[doc(alias = "gtk_spinner_stop")]
653 fn stop(&self) {
654 unsafe {
655 ffi::gtk_spinner_stop(self.as_ref().to_glib_none().0);
656 }
657 }
658
659 fn is_active(&self) -> bool {
660 ObjectExt::property(self.as_ref(), "active")
661 }
662
663 fn set_active(&self, active: bool) {
664 ObjectExt::set_property(self.as_ref(), "active", active)
665 }
666
667 #[doc(alias = "active")]
668 fn connect_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
669 unsafe extern "C" fn notify_active_trampoline<P: IsA<Spinner>, F: Fn(&P) + 'static>(
670 this: *mut ffi::GtkSpinner,
671 _param_spec: glib::ffi::gpointer,
672 f: glib::ffi::gpointer,
673 ) {
674 unsafe {
675 let f: &F = &*(f as *const F);
676 f(Spinner::from_glib_borrow(this).unsafe_cast_ref())
677 }
678 }
679 unsafe {
680 let f: Box_<F> = Box_::new(f);
681 connect_raw(
682 self.as_ptr() as *mut _,
683 c"notify::active".as_ptr(),
684 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
685 notify_active_trampoline::<Self, F> as *const (),
686 )),
687 Box_::into_raw(f),
688 )
689 }
690 }
691}
692
693impl<O: IsA<Spinner>> SpinnerExt for O {}