gtk/auto/statusbar.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, BaselinePosition, Box, Buildable, Container, Orientable, Orientation, ResizeMode,
7 Widget, ffi,
8};
9use glib::{
10 object::ObjectType as _,
11 prelude::*,
12 signal::{SignalHandlerId, connect_raw},
13 translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18 /// A [`Statusbar`][crate::Statusbar] is usually placed along the bottom of an application's
19 /// main [`Window`][crate::Window]. It may provide a regular commentary of the application's
20 /// status (as is usually the case in a web browser, for example), or may be
21 /// used to simply output a message when the status changes, (when an upload
22 /// is complete in an FTP client, for example).
23 ///
24 /// Status bars in GTK+ maintain a stack of messages. The message at
25 /// the top of the each bar’s stack is the one that will currently be displayed.
26 ///
27 /// Any messages added to a statusbar’s stack must specify a
28 /// context id that is used to uniquely identify
29 /// the source of a message. This context id can be generated by
30 /// [`StatusbarExt::context_id()`][crate::prelude::StatusbarExt::context_id()], given a message and the statusbar that
31 /// it will be added to. Note that messages are stored in a stack, and when
32 /// choosing which message to display, the stack structure is adhered to,
33 /// regardless of the context identifier of a message.
34 ///
35 /// One could say that a statusbar maintains one stack of messages for
36 /// display purposes, but allows multiple message producers to maintain
37 /// sub-stacks of the messages they produced (via context ids).
38 ///
39 /// Status bars are created using [`new()`][Self::new()].
40 ///
41 /// Messages are added to the bar’s stack with [`StatusbarExt::push()`][crate::prelude::StatusbarExt::push()].
42 ///
43 /// The message at the top of the stack can be removed using
44 /// [`StatusbarExt::pop()`][crate::prelude::StatusbarExt::pop()]. A message can be removed from anywhere in the
45 /// stack if its message id was recorded at the time it was added. This
46 /// is done using [`StatusbarExt::remove()`][crate::prelude::StatusbarExt::remove()].
47 ///
48 /// # CSS node
49 ///
50 /// GtkStatusbar has a single CSS node with name statusbar.
51 ///
52 /// ## Signals
53 ///
54 ///
55 /// #### `text-popped`
56 /// Is emitted whenever a new message is popped off a statusbar's stack.
57 ///
58 ///
59 ///
60 ///
61 /// #### `text-pushed`
62 /// Is emitted whenever a new message gets pushed onto a statusbar's stack.
63 ///
64 ///
65 /// <details><summary><h4>Container</h4></summary>
66 ///
67 ///
68 /// #### `add`
69 ///
70 ///
71 ///
72 /// #### `check-resize`
73 ///
74 ///
75 ///
76 /// #### `remove`
77 ///
78 ///
79 ///
80 /// #### `set-focus-child`
81 ///
82 /// </details>
83 /// <details><summary><h4>Widget</h4></summary>
84 ///
85 ///
86 /// #### `accel-closures-changed`
87 ///
88 ///
89 ///
90 /// #### `button-press-event`
91 /// The ::button-press-event signal will be emitted when a button
92 /// (typically from a mouse) is pressed.
93 ///
94 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
95 /// widget needs to enable the [`gdk::EventMask::BUTTON_PRESS_MASK`][crate::gdk::EventMask::BUTTON_PRESS_MASK] mask.
96 ///
97 /// This signal will be sent to the grab widget if there is one.
98 ///
99 ///
100 ///
101 ///
102 /// #### `button-release-event`
103 /// The ::button-release-event signal will be emitted when a button
104 /// (typically from a mouse) is released.
105 ///
106 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the
107 /// widget needs to enable the [`gdk::EventMask::BUTTON_RELEASE_MASK`][crate::gdk::EventMask::BUTTON_RELEASE_MASK] mask.
108 ///
109 /// This signal will be sent to the grab widget if there is one.
110 ///
111 ///
112 ///
113 ///
114 /// #### `can-activate-accel`
115 /// Determines whether an accelerator that activates the signal
116 /// identified by `signal_id` can currently be activated.
117 /// This signal is present to allow applications and derived
118 /// widgets to override the default [`Widget`][crate::Widget] handling
119 /// for determining whether an accelerator can be activated.
120 ///
121 ///
122 ///
123 ///
124 /// #### `child-notify`
125 /// The ::child-notify signal is emitted for each
126 /// [child property][child-properties] that has
127 /// changed on an object. The signal's detail holds the property name.
128 ///
129 /// Detailed
130 ///
131 ///
132 /// #### `composited-changed`
133 /// The ::composited-changed signal is emitted when the composited
134 /// status of `widgets` screen changes.
135 /// See [`Screen::is_composited()`][crate::gdk::Screen::is_composited()].
136 ///
137 /// Action
138 ///
139 ///
140 /// #### `configure-event`
141 /// The ::configure-event signal will be emitted when the size, position or
142 /// stacking of the `widget`'s window has changed.
143 ///
144 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
145 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
146 /// automatically for all new windows.
147 ///
148 ///
149 ///
150 ///
151 /// #### `damage-event`
152 /// Emitted when a redirected window belonging to `widget` gets drawn into.
153 /// The region/area members of the event shows what area of the redirected
154 /// drawable was drawn into.
155 ///
156 ///
157 ///
158 ///
159 /// #### `delete-event`
160 /// The ::delete-event signal is emitted if a user requests that
161 /// a toplevel window is closed. The default handler for this signal
162 /// destroys the window. Connecting [`WidgetExtManual::hide_on_delete()`][crate::prelude::WidgetExtManual::hide_on_delete()] to
163 /// this signal will cause the window to be hidden instead, so that
164 /// it can later be shown again without reconstructing it.
165 ///
166 ///
167 ///
168 ///
169 /// #### `destroy`
170 /// Signals that all holders of a reference to the widget should release
171 /// the reference that they hold. May result in finalization of the widget
172 /// if all references are released.
173 ///
174 /// This signal is not suitable for saving widget state.
175 ///
176 ///
177 ///
178 ///
179 /// #### `destroy-event`
180 /// The ::destroy-event signal is emitted when a [`gdk::Window`][crate::gdk::Window] is destroyed.
181 /// You rarely get this signal, because most widgets disconnect themselves
182 /// from their window before they destroy it, so no widget owns the
183 /// window at destroy time.
184 ///
185 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
186 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
187 /// automatically for all new windows.
188 ///
189 ///
190 ///
191 ///
192 /// #### `direction-changed`
193 /// The ::direction-changed signal is emitted when the text direction
194 /// of a widget changes.
195 ///
196 ///
197 ///
198 ///
199 /// #### `drag-begin`
200 /// The ::drag-begin signal is emitted on the drag source when a drag is
201 /// started. A typical reason to connect to this signal is to set up a
202 /// custom drag icon with e.g. [`WidgetExt::drag_source_set_icon_pixbuf()`][crate::prelude::WidgetExt::drag_source_set_icon_pixbuf()].
203 ///
204 /// Note that some widgets set up a drag icon in the default handler of
205 /// this signal, so you may have to use `g_signal_connect_after()` to
206 /// override what the default handler did.
207 ///
208 ///
209 ///
210 ///
211 /// #### `drag-data-delete`
212 /// The ::drag-data-delete signal is emitted on the drag source when a drag
213 /// with the action [`gdk::DragAction::MOVE`][crate::gdk::DragAction::MOVE] is successfully completed. The signal
214 /// handler is responsible for deleting the data that has been dropped. What
215 /// "delete" means depends on the context of the drag operation.
216 ///
217 ///
218 ///
219 ///
220 /// #### `drag-data-get`
221 /// The ::drag-data-get signal is emitted on the drag source when the drop
222 /// site requests the data which is dragged. It is the responsibility of
223 /// the signal handler to fill `data` with the data in the format which
224 /// is indicated by `info`. See [`SelectionData::set()`][crate::SelectionData::set()] and
225 /// [`SelectionData::set_text()`][crate::SelectionData::set_text()].
226 ///
227 ///
228 ///
229 ///
230 /// #### `drag-data-received`
231 /// format == 8))
232 /// {
233 /// GdkDragAction action;
234 ///
235 /// // handle data here
236 ///
237 /// action = gdk_drag_context_get_selected_action (context);
238 /// if (action == GDK_ACTION_ASK)
239 /// {
240 /// GtkWidget *dialog;
241 /// gint response;
242 ///
243 /// dialog = gtk_message_dialog_new (NULL,
244 /// GTK_DIALOG_MODAL |
245 /// GTK_DIALOG_DESTROY_WITH_PARENT,
246 /// GTK_MESSAGE_INFO,
247 /// GTK_BUTTONS_YES_NO,
248 /// "Move the data ?\n");
249 /// response = gtk_dialog_run (GTK_DIALOG (dialog));
250 /// gtk_widget_destroy (dialog);
251 ///
252 /// if (response == GTK_RESPONSE_YES)
253 /// action = GDK_ACTION_MOVE;
254 /// else
255 /// action = GDK_ACTION_COPY;
256 /// }
257 ///
258 /// gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
259 /// }
260 /// else
261 /// gtk_drag_finish (context, FALSE, FALSE, time);
262 /// }
263 /// ]|
264 ///
265 ///
266 ///
267 ///
268 /// #### `drag-drop`
269 /// The ::drag-drop signal is emitted on the drop site when the user drops
270 /// the data onto the widget. The signal handler must determine whether
271 /// the cursor position is in a drop zone or not. If it is not in a drop
272 /// zone, it returns [`false`] and no further processing is necessary.
273 /// Otherwise, the handler returns [`true`]. In this case, the handler must
274 /// ensure that `gtk_drag_finish()` is called to let the source know that
275 /// the drop is done. The call to `gtk_drag_finish()` can be done either
276 /// directly or in a [`drag-data-received`][struct@crate::Widget#drag-data-received] handler which gets
277 /// triggered by calling [`WidgetExt::drag_get_data()`][crate::prelude::WidgetExt::drag_get_data()] to receive the data for one
278 /// or more of the supported targets.
279 ///
280 ///
281 ///
282 ///
283 /// #### `drag-end`
284 /// The ::drag-end signal is emitted on the drag source when a drag is
285 /// finished. A typical reason to connect to this signal is to undo
286 /// things done in [`drag-begin`][struct@crate::Widget#drag-begin].
287 ///
288 ///
289 ///
290 ///
291 /// #### `drag-failed`
292 /// The ::drag-failed signal is emitted on the drag source when a drag has
293 /// failed. The signal handler may hook custom code to handle a failed DnD
294 /// operation based on the type of error, it returns [`true`] is the failure has
295 /// been already handled (not showing the default "drag operation failed"
296 /// animation), otherwise it returns [`false`].
297 ///
298 ///
299 ///
300 ///
301 /// #### `drag-leave`
302 /// The ::drag-leave signal is emitted on the drop site when the cursor
303 /// leaves the widget. A typical reason to connect to this signal is to
304 /// undo things done in [`drag-motion`][struct@crate::Widget#drag-motion], e.g. undo highlighting
305 /// with [`WidgetExt::drag_unhighlight()`][crate::prelude::WidgetExt::drag_unhighlight()].
306 ///
307 ///
308 /// Likewise, the [`drag-leave`][struct@crate::Widget#drag-leave] signal is also emitted before the
309 /// ::drag-drop signal, for instance to allow cleaning up of a preview item
310 /// created in the [`drag-motion`][struct@crate::Widget#drag-motion] signal handler.
311 ///
312 ///
313 ///
314 ///
315 /// #### `drag-motion`
316 /// suggested_action,
317 /// time);
318 /// }
319 /// else
320 /// {
321 /// // accept the drop
322 /// }
323 /// }
324 /// ]|
325 ///
326 ///
327 ///
328 ///
329 /// #### `draw`
330 /// This signal is emitted when a widget is supposed to render itself.
331 /// The `widget`'s top left corner must be painted at the origin of
332 /// the passed in context and be sized to the values returned by
333 /// [`WidgetExt::allocated_width()`][crate::prelude::WidgetExt::allocated_width()] and
334 /// [`WidgetExt::allocated_height()`][crate::prelude::WidgetExt::allocated_height()].
335 ///
336 /// Signal handlers connected to this signal can modify the cairo
337 /// context passed as `cr` in any way they like and don't need to
338 /// restore it. The signal emission takes care of calling `cairo_save()`
339 /// before and `cairo_restore()` after invoking the handler.
340 ///
341 /// The signal handler will get a `cr` with a clip region already set to the
342 /// widget's dirty region, i.e. to the area that needs repainting. Complicated
343 /// widgets that want to avoid redrawing themselves completely can get the full
344 /// extents of the clip region with `gdk_cairo_get_clip_rectangle()`, or they can
345 /// get a finer-grained representation of the dirty region with
346 /// `cairo_copy_clip_rectangle_list()`.
347 ///
348 ///
349 ///
350 ///
351 /// #### `enter-notify-event`
352 /// The ::enter-notify-event will be emitted when the pointer enters
353 /// the `widget`'s window.
354 ///
355 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
356 /// to enable the [`gdk::EventMask::ENTER_NOTIFY_MASK`][crate::gdk::EventMask::ENTER_NOTIFY_MASK] mask.
357 ///
358 /// This signal will be sent to the grab widget if there is one.
359 ///
360 ///
361 ///
362 ///
363 /// #### `event`
364 /// The GTK+ main loop will emit three signals for each GDK event delivered
365 /// to a widget: one generic ::event signal, another, more specific,
366 /// signal that matches the type of event delivered (e.g.
367 /// [`key-press-event`][struct@crate::Widget#key-press-event]) and finally a generic
368 /// [`event-after`][struct@crate::Widget#event-after] signal.
369 ///
370 ///
371 ///
372 ///
373 /// #### `event-after`
374 /// After the emission of the [`event`][struct@crate::Widget#event] signal and (optionally)
375 /// the second more specific signal, ::event-after will be emitted
376 /// regardless of the previous two signals handlers return values.
377 ///
378 ///
379 ///
380 ///
381 /// #### `focus`
382 ///
383 ///
384 ///
385 /// #### `focus-in-event`
386 /// The ::focus-in-event signal will be emitted when the keyboard focus
387 /// enters the `widget`'s window.
388 ///
389 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
390 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
391 ///
392 ///
393 ///
394 ///
395 /// #### `focus-out-event`
396 /// The ::focus-out-event signal will be emitted when the keyboard focus
397 /// leaves the `widget`'s window.
398 ///
399 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
400 /// to enable the [`gdk::EventMask::FOCUS_CHANGE_MASK`][crate::gdk::EventMask::FOCUS_CHANGE_MASK] mask.
401 ///
402 ///
403 ///
404 ///
405 /// #### `grab-broken-event`
406 /// Emitted when a pointer or keyboard grab on a window belonging
407 /// to `widget` gets broken.
408 ///
409 /// On X11, this happens when the grab window becomes unviewable
410 /// (i.e. it or one of its ancestors is unmapped), or if the same
411 /// application grabs the pointer or keyboard again.
412 ///
413 ///
414 ///
415 ///
416 /// #### `grab-focus`
417 /// Action
418 ///
419 ///
420 /// #### `grab-notify`
421 /// The ::grab-notify signal is emitted when a widget becomes
422 /// shadowed by a GTK+ grab (not a pointer or keyboard grab) on
423 /// another widget, or when it becomes unshadowed due to a grab
424 /// being removed.
425 ///
426 /// A widget is shadowed by a [`WidgetExt::grab_add()`][crate::prelude::WidgetExt::grab_add()] when the topmost
427 /// grab widget in the grab stack of its window group is not
428 /// its ancestor.
429 ///
430 ///
431 ///
432 ///
433 /// #### `hide`
434 /// The ::hide signal is emitted when `widget` is hidden, for example with
435 /// [`WidgetExt::hide()`][crate::prelude::WidgetExt::hide()].
436 ///
437 ///
438 ///
439 ///
440 /// #### `hierarchy-changed`
441 /// The ::hierarchy-changed signal is emitted when the
442 /// anchored state of a widget changes. A widget is
443 /// “anchored” when its toplevel
444 /// ancestor is a [`Window`][crate::Window]. This signal is emitted when
445 /// a widget changes from un-anchored to anchored or vice-versa.
446 ///
447 ///
448 ///
449 ///
450 /// #### `key-press-event`
451 /// The ::key-press-event signal is emitted when a key is pressed. The signal
452 /// emission will reoccur at the key-repeat rate when the key is kept pressed.
453 ///
454 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
455 /// to enable the [`gdk::EventMask::KEY_PRESS_MASK`][crate::gdk::EventMask::KEY_PRESS_MASK] mask.
456 ///
457 /// This signal will be sent to the grab widget if there is one.
458 ///
459 ///
460 ///
461 ///
462 /// #### `key-release-event`
463 /// The ::key-release-event signal is emitted when a key is released.
464 ///
465 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
466 /// to enable the [`gdk::EventMask::KEY_RELEASE_MASK`][crate::gdk::EventMask::KEY_RELEASE_MASK] mask.
467 ///
468 /// This signal will be sent to the grab widget if there is one.
469 ///
470 ///
471 ///
472 ///
473 /// #### `keynav-failed`
474 /// Gets emitted if keyboard navigation fails.
475 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
476 ///
477 ///
478 ///
479 ///
480 /// #### `leave-notify-event`
481 /// The ::leave-notify-event will be emitted when the pointer leaves
482 /// the `widget`'s window.
483 ///
484 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
485 /// to enable the [`gdk::EventMask::LEAVE_NOTIFY_MASK`][crate::gdk::EventMask::LEAVE_NOTIFY_MASK] mask.
486 ///
487 /// This signal will be sent to the grab widget if there is one.
488 ///
489 ///
490 ///
491 ///
492 /// #### `map`
493 /// The ::map signal is emitted when `widget` is going to be mapped, that is
494 /// when the widget is visible (which is controlled with
495 /// [`WidgetExt::set_visible()`][crate::prelude::WidgetExt::set_visible()]) and all its parents up to the toplevel widget
496 /// are also visible. Once the map has occurred, [`map-event`][struct@crate::Widget#map-event] will
497 /// be emitted.
498 ///
499 /// The ::map signal can be used to determine whether a widget will be drawn,
500 /// for instance it can resume an animation that was stopped during the
501 /// emission of [`unmap`][struct@crate::Widget#unmap].
502 ///
503 ///
504 ///
505 ///
506 /// #### `map-event`
507 /// The ::map-event signal will be emitted when the `widget`'s window is
508 /// mapped. A window is mapped when it becomes visible on the screen.
509 ///
510 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
511 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
512 /// automatically for all new windows.
513 ///
514 ///
515 ///
516 ///
517 /// #### `mnemonic-activate`
518 /// The default handler for this signal activates `widget` if `group_cycling`
519 /// is [`false`], or just makes `widget` grab focus if `group_cycling` is [`true`].
520 ///
521 ///
522 ///
523 ///
524 /// #### `motion-notify-event`
525 /// The ::motion-notify-event signal is emitted when the pointer moves
526 /// over the widget's [`gdk::Window`][crate::gdk::Window].
527 ///
528 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget
529 /// needs to enable the [`gdk::EventMask::POINTER_MOTION_MASK`][crate::gdk::EventMask::POINTER_MOTION_MASK] mask.
530 ///
531 /// This signal will be sent to the grab widget if there is one.
532 ///
533 ///
534 ///
535 ///
536 /// #### `move-focus`
537 /// Action
538 ///
539 ///
540 /// #### `parent-set`
541 /// The ::parent-set signal is emitted when a new parent
542 /// has been set on a widget.
543 ///
544 ///
545 ///
546 ///
547 /// #### `popup-menu`
548 /// This signal gets emitted whenever a widget should pop up a context
549 /// menu. This usually happens through the standard key binding mechanism;
550 /// by pressing a certain key while a widget is focused, the user can cause
551 /// the widget to pop up a menu. For example, the [`Entry`][crate::Entry] widget creates
552 /// a menu with clipboard commands. See the
553 /// [Popup Menu Migration Checklist][checklist-popup-menu]
554 /// for an example of how to use this signal.
555 ///
556 /// Action
557 ///
558 ///
559 /// #### `property-notify-event`
560 /// The ::property-notify-event signal will be emitted when a property on
561 /// the `widget`'s window has been changed or deleted.
562 ///
563 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
564 /// to enable the [`gdk::EventMask::PROPERTY_CHANGE_MASK`][crate::gdk::EventMask::PROPERTY_CHANGE_MASK] mask.
565 ///
566 ///
567 ///
568 ///
569 /// #### `proximity-in-event`
570 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
571 /// to enable the [`gdk::EventMask::PROXIMITY_IN_MASK`][crate::gdk::EventMask::PROXIMITY_IN_MASK] mask.
572 ///
573 /// This signal will be sent to the grab widget if there is one.
574 ///
575 ///
576 ///
577 ///
578 /// #### `proximity-out-event`
579 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
580 /// to enable the [`gdk::EventMask::PROXIMITY_OUT_MASK`][crate::gdk::EventMask::PROXIMITY_OUT_MASK] mask.
581 ///
582 /// This signal will be sent to the grab widget if there is one.
583 ///
584 ///
585 ///
586 ///
587 /// #### `query-tooltip`
588 /// Emitted when [`has-tooltip`][struct@crate::Widget#has-tooltip] is [`true`] and the hover timeout
589 /// has expired with the cursor hovering "above" `widget`; or emitted when `widget` got
590 /// focus in keyboard mode.
591 ///
592 /// Using the given coordinates, the signal handler should determine
593 /// whether a tooltip should be shown for `widget`. If this is the case
594 /// [`true`] should be returned, [`false`] otherwise. Note that if
595 /// `keyboard_mode` is [`true`], the values of `x` and `y` are undefined and
596 /// should not be used.
597 ///
598 /// The signal handler is free to manipulate `tooltip` with the therefore
599 /// destined function calls.
600 ///
601 ///
602 ///
603 ///
604 /// #### `realize`
605 /// The ::realize signal is emitted when `widget` is associated with a
606 /// [`gdk::Window`][crate::gdk::Window], which means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called or the
607 /// widget has been mapped (that is, it is going to be drawn).
608 ///
609 ///
610 ///
611 ///
612 /// #### `screen-changed`
613 /// The ::screen-changed signal gets emitted when the
614 /// screen of a widget has changed.
615 ///
616 ///
617 ///
618 ///
619 /// #### `scroll-event`
620 /// The ::scroll-event signal is emitted when a button in the 4 to 7
621 /// range is pressed. Wheel mice are usually configured to generate
622 /// button press events for buttons 4 and 5 when the wheel is turned.
623 ///
624 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
625 /// to enable the [`gdk::EventMask::SCROLL_MASK`][crate::gdk::EventMask::SCROLL_MASK] mask.
626 ///
627 /// This signal will be sent to the grab widget if there is one.
628 ///
629 ///
630 ///
631 ///
632 /// #### `selection-clear-event`
633 /// The ::selection-clear-event signal will be emitted when the
634 /// the `widget`'s window has lost ownership of a selection.
635 ///
636 ///
637 ///
638 ///
639 /// #### `selection-get`
640 ///
641 ///
642 ///
643 /// #### `selection-notify-event`
644 ///
645 ///
646 ///
647 /// #### `selection-received`
648 ///
649 ///
650 ///
651 /// #### `selection-request-event`
652 /// The ::selection-request-event signal will be emitted when
653 /// another client requests ownership of the selection owned by
654 /// the `widget`'s window.
655 ///
656 ///
657 ///
658 ///
659 /// #### `show`
660 /// The ::show signal is emitted when `widget` is shown, for example with
661 /// [`WidgetExt::show()`][crate::prelude::WidgetExt::show()].
662 ///
663 ///
664 ///
665 ///
666 /// #### `show-help`
667 /// Action
668 ///
669 ///
670 /// #### `size-allocate`
671 ///
672 ///
673 ///
674 /// #### `state-changed`
675 /// The ::state-changed signal is emitted when the widget state changes.
676 /// See `gtk_widget_get_state()`.
677 ///
678 ///
679 ///
680 ///
681 /// #### `state-flags-changed`
682 /// The ::state-flags-changed signal is emitted when the widget state
683 /// changes, see [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
684 ///
685 ///
686 ///
687 ///
688 /// #### `style-set`
689 /// The ::style-set signal is emitted when a new style has been set
690 /// on a widget. Note that style-modifying functions like
691 /// `gtk_widget_modify_base()` also cause this signal to be emitted.
692 ///
693 /// Note that this signal is emitted for changes to the deprecated
694 /// `GtkStyle`. To track changes to the [`StyleContext`][crate::StyleContext] associated
695 /// with a widget, use the [`style-updated`][struct@crate::Widget#style-updated] signal.
696 ///
697 ///
698 ///
699 ///
700 /// #### `style-updated`
701 /// The ::style-updated signal is a convenience signal that is emitted when the
702 /// [`changed`][struct@crate::StyleContext#changed] signal is emitted on the `widget`'s associated
703 /// [`StyleContext`][crate::StyleContext] as returned by [`WidgetExt::style_context()`][crate::prelude::WidgetExt::style_context()].
704 ///
705 /// Note that style-modifying functions like `gtk_widget_override_color()` also
706 /// cause this signal to be emitted.
707 ///
708 ///
709 ///
710 ///
711 /// #### `touch-event`
712 ///
713 ///
714 ///
715 /// #### `unmap`
716 /// The ::unmap signal is emitted when `widget` is going to be unmapped, which
717 /// means that either it or any of its parents up to the toplevel widget have
718 /// been set as hidden.
719 ///
720 /// As ::unmap indicates that a widget will not be shown any longer, it can be
721 /// used to, for example, stop an animation on the widget.
722 ///
723 ///
724 ///
725 ///
726 /// #### `unmap-event`
727 /// The ::unmap-event signal will be emitted when the `widget`'s window is
728 /// unmapped. A window is unmapped when it becomes invisible on the screen.
729 ///
730 /// To receive this signal, the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
731 /// to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable this mask
732 /// automatically for all new windows.
733 ///
734 ///
735 ///
736 ///
737 /// #### `unrealize`
738 /// The ::unrealize signal is emitted when the [`gdk::Window`][crate::gdk::Window] associated with
739 /// `widget` is destroyed, which means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been
740 /// called or the widget has been unmapped (that is, it is going to be
741 /// hidden).
742 ///
743 ///
744 ///
745 ///
746 /// #### `visibility-notify-event`
747 /// The ::visibility-notify-event will be emitted when the `widget`'s
748 /// window is obscured or unobscured.
749 ///
750 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget needs
751 /// to enable the [`gdk::EventMask::VISIBILITY_NOTIFY_MASK`][crate::gdk::EventMask::VISIBILITY_NOTIFY_MASK] mask.
752 ///
753 ///
754 ///
755 ///
756 /// #### `window-state-event`
757 /// The ::window-state-event will be emitted when the state of the
758 /// toplevel window associated to the `widget` changes.
759 ///
760 /// To receive this signal the [`gdk::Window`][crate::gdk::Window] associated to the widget
761 /// needs to enable the [`gdk::EventMask::STRUCTURE_MASK`][crate::gdk::EventMask::STRUCTURE_MASK] mask. GDK will enable
762 /// this mask automatically for all new windows.
763 ///
764 ///
765 /// </details>
766 ///
767 /// # Implements
768 ///
769 /// [`StatusbarExt`][trait@crate::prelude::StatusbarExt], [`BoxExt`][trait@crate::prelude::BoxExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`OrientableExt`][trait@crate::prelude::OrientableExt], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
770 #[doc(alias = "GtkStatusbar")]
771 pub struct Statusbar(Object<ffi::GtkStatusbar, ffi::GtkStatusbarClass>) @extends Box, Container, Widget, @implements Buildable, Orientable;
772
773 match fn {
774 type_ => || ffi::gtk_statusbar_get_type(),
775 }
776}
777
778impl Statusbar {
779 pub const NONE: Option<&'static Statusbar> = None;
780
781 /// Creates a new [`Statusbar`][crate::Statusbar] ready for messages.
782 ///
783 /// # Returns
784 ///
785 /// the new [`Statusbar`][crate::Statusbar]
786 #[doc(alias = "gtk_statusbar_new")]
787 pub fn new() -> Statusbar {
788 assert_initialized_main_thread!();
789 unsafe { Widget::from_glib_none(ffi::gtk_statusbar_new()).unsafe_cast() }
790 }
791
792 // rustdoc-stripper-ignore-next
793 /// Creates a new builder-pattern struct instance to construct [`Statusbar`] objects.
794 ///
795 /// This method returns an instance of [`StatusbarBuilder`](crate::builders::StatusbarBuilder) which can be used to create [`Statusbar`] objects.
796 pub fn builder() -> StatusbarBuilder {
797 StatusbarBuilder::new()
798 }
799}
800
801impl Default for Statusbar {
802 fn default() -> Self {
803 Self::new()
804 }
805}
806
807// rustdoc-stripper-ignore-next
808/// A [builder-pattern] type to construct [`Statusbar`] objects.
809///
810/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
811#[must_use = "The builder must be built to be used"]
812pub struct StatusbarBuilder {
813 builder: glib::object::ObjectBuilder<'static, Statusbar>,
814}
815
816impl StatusbarBuilder {
817 fn new() -> Self {
818 Self {
819 builder: glib::object::Object::builder(),
820 }
821 }
822
823 pub fn baseline_position(self, baseline_position: BaselinePosition) -> Self {
824 Self {
825 builder: self
826 .builder
827 .property("baseline-position", baseline_position),
828 }
829 }
830
831 pub fn homogeneous(self, homogeneous: bool) -> Self {
832 Self {
833 builder: self.builder.property("homogeneous", homogeneous),
834 }
835 }
836
837 pub fn spacing(self, spacing: i32) -> Self {
838 Self {
839 builder: self.builder.property("spacing", spacing),
840 }
841 }
842
843 pub fn border_width(self, border_width: u32) -> Self {
844 Self {
845 builder: self.builder.property("border-width", border_width),
846 }
847 }
848
849 pub fn child(self, child: &impl IsA<Widget>) -> Self {
850 Self {
851 builder: self.builder.property("child", child.clone().upcast()),
852 }
853 }
854
855 pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
856 Self {
857 builder: self.builder.property("resize-mode", resize_mode),
858 }
859 }
860
861 pub fn app_paintable(self, app_paintable: bool) -> Self {
862 Self {
863 builder: self.builder.property("app-paintable", app_paintable),
864 }
865 }
866
867 pub fn can_default(self, can_default: bool) -> Self {
868 Self {
869 builder: self.builder.property("can-default", can_default),
870 }
871 }
872
873 pub fn can_focus(self, can_focus: bool) -> Self {
874 Self {
875 builder: self.builder.property("can-focus", can_focus),
876 }
877 }
878
879 pub fn events(self, events: gdk::EventMask) -> Self {
880 Self {
881 builder: self.builder.property("events", events),
882 }
883 }
884
885 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
886 pub fn expand(self, expand: bool) -> Self {
887 Self {
888 builder: self.builder.property("expand", expand),
889 }
890 }
891
892 /// Whether the widget should grab focus when it is clicked with the mouse.
893 ///
894 /// This property is only relevant for widgets that can take focus.
895 ///
896 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
897 /// GtkComboBox) implemented this property individually.
898 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
899 Self {
900 builder: self.builder.property("focus-on-click", focus_on_click),
901 }
902 }
903
904 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
905 pub fn halign(self, halign: Align) -> Self {
906 Self {
907 builder: self.builder.property("halign", halign),
908 }
909 }
910
911 pub fn has_default(self, has_default: bool) -> Self {
912 Self {
913 builder: self.builder.property("has-default", has_default),
914 }
915 }
916
917 pub fn has_focus(self, has_focus: bool) -> Self {
918 Self {
919 builder: self.builder.property("has-focus", has_focus),
920 }
921 }
922
923 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
924 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
925 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
926 /// whether it will provide a tooltip or not.
927 ///
928 /// Note that setting this property to [`true`] for the first time will change
929 /// the event masks of the GdkWindows of this widget to include leave-notify
930 /// and motion-notify events. This cannot and will not be undone when the
931 /// property is set to [`false`] again.
932 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
933 Self {
934 builder: self.builder.property("has-tooltip", has_tooltip),
935 }
936 }
937
938 pub fn height_request(self, height_request: i32) -> Self {
939 Self {
940 builder: self.builder.property("height-request", height_request),
941 }
942 }
943
944 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
945 pub fn hexpand(self, hexpand: bool) -> Self {
946 Self {
947 builder: self.builder.property("hexpand", hexpand),
948 }
949 }
950
951 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
952 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
953 Self {
954 builder: self.builder.property("hexpand-set", hexpand_set),
955 }
956 }
957
958 pub fn is_focus(self, is_focus: bool) -> Self {
959 Self {
960 builder: self.builder.property("is-focus", is_focus),
961 }
962 }
963
964 /// Sets all four sides' margin at once. If read, returns max
965 /// margin on any side.
966 pub fn margin(self, margin: i32) -> Self {
967 Self {
968 builder: self.builder.property("margin", margin),
969 }
970 }
971
972 /// Margin on bottom side of widget.
973 ///
974 /// This property adds margin outside of the widget's normal size
975 /// request, the margin will be added in addition to the size from
976 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
977 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
978 Self {
979 builder: self.builder.property("margin-bottom", margin_bottom),
980 }
981 }
982
983 /// Margin on end of widget, horizontally. This property supports
984 /// left-to-right and right-to-left text directions.
985 ///
986 /// This property adds margin outside of the widget's normal size
987 /// request, the margin will be added in addition to the size from
988 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
989 pub fn margin_end(self, margin_end: i32) -> Self {
990 Self {
991 builder: self.builder.property("margin-end", margin_end),
992 }
993 }
994
995 /// Margin on start of widget, horizontally. This property supports
996 /// left-to-right and right-to-left text directions.
997 ///
998 /// This property adds margin outside of the widget's normal size
999 /// request, the margin will be added in addition to the size from
1000 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1001 pub fn margin_start(self, margin_start: i32) -> Self {
1002 Self {
1003 builder: self.builder.property("margin-start", margin_start),
1004 }
1005 }
1006
1007 /// Margin on top side of widget.
1008 ///
1009 /// This property adds margin outside of the widget's normal size
1010 /// request, the margin will be added in addition to the size from
1011 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1012 pub fn margin_top(self, margin_top: i32) -> Self {
1013 Self {
1014 builder: self.builder.property("margin-top", margin_top),
1015 }
1016 }
1017
1018 pub fn name(self, name: impl Into<glib::GString>) -> Self {
1019 Self {
1020 builder: self.builder.property("name", name.into()),
1021 }
1022 }
1023
1024 pub fn no_show_all(self, no_show_all: bool) -> Self {
1025 Self {
1026 builder: self.builder.property("no-show-all", no_show_all),
1027 }
1028 }
1029
1030 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
1031 /// more details about window opacity.
1032 ///
1033 /// Before 3.8 this was only available in GtkWindow
1034 pub fn opacity(self, opacity: f64) -> Self {
1035 Self {
1036 builder: self.builder.property("opacity", opacity),
1037 }
1038 }
1039
1040 pub fn parent(self, parent: &impl IsA<Container>) -> Self {
1041 Self {
1042 builder: self.builder.property("parent", parent.clone().upcast()),
1043 }
1044 }
1045
1046 pub fn receives_default(self, receives_default: bool) -> Self {
1047 Self {
1048 builder: self.builder.property("receives-default", receives_default),
1049 }
1050 }
1051
1052 pub fn sensitive(self, sensitive: bool) -> Self {
1053 Self {
1054 builder: self.builder.property("sensitive", sensitive),
1055 }
1056 }
1057
1058 /// Sets the text of tooltip to be the given string, which is marked up
1059 /// with the [Pango text markup language][PangoMarkupFormat].
1060 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1061 ///
1062 /// This is a convenience property which will take care of getting the
1063 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1064 /// will automatically be set to [`true`] and there will be taken care of
1065 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1066 ///
1067 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1068 /// are set, the last one wins.
1069 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1070 Self {
1071 builder: self
1072 .builder
1073 .property("tooltip-markup", tooltip_markup.into()),
1074 }
1075 }
1076
1077 /// Sets the text of tooltip to be the given string.
1078 ///
1079 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1080 ///
1081 /// This is a convenience property which will take care of getting the
1082 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1083 /// will automatically be set to [`true`] and there will be taken care of
1084 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1085 ///
1086 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1087 /// are set, the last one wins.
1088 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1089 Self {
1090 builder: self.builder.property("tooltip-text", tooltip_text.into()),
1091 }
1092 }
1093
1094 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
1095 pub fn valign(self, valign: Align) -> Self {
1096 Self {
1097 builder: self.builder.property("valign", valign),
1098 }
1099 }
1100
1101 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
1102 pub fn vexpand(self, vexpand: bool) -> Self {
1103 Self {
1104 builder: self.builder.property("vexpand", vexpand),
1105 }
1106 }
1107
1108 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
1109 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1110 Self {
1111 builder: self.builder.property("vexpand-set", vexpand_set),
1112 }
1113 }
1114
1115 pub fn visible(self, visible: bool) -> Self {
1116 Self {
1117 builder: self.builder.property("visible", visible),
1118 }
1119 }
1120
1121 pub fn width_request(self, width_request: i32) -> Self {
1122 Self {
1123 builder: self.builder.property("width-request", width_request),
1124 }
1125 }
1126
1127 /// The orientation of the orientable.
1128 pub fn orientation(self, orientation: Orientation) -> Self {
1129 Self {
1130 builder: self.builder.property("orientation", orientation),
1131 }
1132 }
1133
1134 // rustdoc-stripper-ignore-next
1135 /// Build the [`Statusbar`].
1136 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1137 pub fn build(self) -> Statusbar {
1138 assert_initialized_main_thread!();
1139 self.builder.build()
1140 }
1141}
1142
1143/// Trait containing all [`struct@Statusbar`] methods.
1144///
1145/// # Implementors
1146///
1147/// [`Statusbar`][struct@crate::Statusbar]
1148pub trait StatusbarExt: IsA<Statusbar> + 'static {
1149 /// Returns a new context identifier, given a description
1150 /// of the actual context. Note that the description is
1151 /// not shown in the UI.
1152 /// ## `context_description`
1153 /// textual description of what context
1154 /// the new message is being used in
1155 ///
1156 /// # Returns
1157 ///
1158 /// an integer id
1159 #[doc(alias = "gtk_statusbar_get_context_id")]
1160 #[doc(alias = "get_context_id")]
1161 fn context_id(&self, context_description: &str) -> u32 {
1162 unsafe {
1163 ffi::gtk_statusbar_get_context_id(
1164 self.as_ref().to_glib_none().0,
1165 context_description.to_glib_none().0,
1166 )
1167 }
1168 }
1169
1170 /// Retrieves the box containing the label widget.
1171 ///
1172 /// # Returns
1173 ///
1174 /// a [`Box`][crate::Box]
1175 #[doc(alias = "gtk_statusbar_get_message_area")]
1176 #[doc(alias = "get_message_area")]
1177 fn message_area(&self) -> Option<Box> {
1178 unsafe {
1179 from_glib_none(ffi::gtk_statusbar_get_message_area(
1180 self.as_ref().to_glib_none().0,
1181 ))
1182 }
1183 }
1184
1185 /// Removes the first message in the [`Statusbar`][crate::Statusbar]’s stack
1186 /// with the given context id.
1187 ///
1188 /// Note that this may not change the displayed message, if
1189 /// the message at the top of the stack has a different
1190 /// context id.
1191 /// ## `context_id`
1192 /// a context identifier
1193 #[doc(alias = "gtk_statusbar_pop")]
1194 fn pop(&self, context_id: u32) {
1195 unsafe {
1196 ffi::gtk_statusbar_pop(self.as_ref().to_glib_none().0, context_id);
1197 }
1198 }
1199
1200 /// Pushes a new message onto a statusbar’s stack.
1201 /// ## `context_id`
1202 /// the message’s context id, as returned by
1203 /// [`context_id()`][Self::context_id()]
1204 /// ## `text`
1205 /// the message to add to the statusbar
1206 ///
1207 /// # Returns
1208 ///
1209 /// a message id that can be used with
1210 /// [`remove()`][Self::remove()].
1211 #[doc(alias = "gtk_statusbar_push")]
1212 fn push(&self, context_id: u32, text: &str) -> u32 {
1213 unsafe {
1214 ffi::gtk_statusbar_push(
1215 self.as_ref().to_glib_none().0,
1216 context_id,
1217 text.to_glib_none().0,
1218 )
1219 }
1220 }
1221
1222 /// Forces the removal of a message from a statusbar’s stack.
1223 /// The exact `context_id` and `message_id` must be specified.
1224 /// ## `context_id`
1225 /// a context identifier
1226 /// ## `message_id`
1227 /// a message identifier, as returned by [`push()`][Self::push()]
1228 #[doc(alias = "gtk_statusbar_remove")]
1229 fn remove(&self, context_id: u32, message_id: u32) {
1230 unsafe {
1231 ffi::gtk_statusbar_remove(self.as_ref().to_glib_none().0, context_id, message_id);
1232 }
1233 }
1234
1235 /// Forces the removal of all messages from a statusbar's
1236 /// stack with the exact `context_id`.
1237 /// ## `context_id`
1238 /// a context identifier
1239 #[doc(alias = "gtk_statusbar_remove_all")]
1240 fn remove_all(&self, context_id: u32) {
1241 unsafe {
1242 ffi::gtk_statusbar_remove_all(self.as_ref().to_glib_none().0, context_id);
1243 }
1244 }
1245
1246 /// Is emitted whenever a new message is popped off a statusbar's stack.
1247 /// ## `context_id`
1248 /// the context id of the relevant message/statusbar
1249 /// ## `text`
1250 /// the message that was just popped
1251 #[doc(alias = "text-popped")]
1252 fn connect_text_popped<F: Fn(&Self, u32, &str) + 'static>(&self, f: F) -> SignalHandlerId {
1253 unsafe extern "C" fn text_popped_trampoline<
1254 P: IsA<Statusbar>,
1255 F: Fn(&P, u32, &str) + 'static,
1256 >(
1257 this: *mut ffi::GtkStatusbar,
1258 context_id: std::ffi::c_uint,
1259 text: *mut std::ffi::c_char,
1260 f: glib::ffi::gpointer,
1261 ) {
1262 unsafe {
1263 let f: &F = &*(f as *const F);
1264 f(
1265 Statusbar::from_glib_borrow(this).unsafe_cast_ref(),
1266 context_id,
1267 &glib::GString::from_glib_borrow(text),
1268 )
1269 }
1270 }
1271 unsafe {
1272 let f: Box_<F> = Box_::new(f);
1273 connect_raw(
1274 self.as_ptr() as *mut _,
1275 c"text-popped".as_ptr(),
1276 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1277 text_popped_trampoline::<Self, F> as *const (),
1278 )),
1279 Box_::into_raw(f),
1280 )
1281 }
1282 }
1283
1284 /// Is emitted whenever a new message gets pushed onto a statusbar's stack.
1285 /// ## `context_id`
1286 /// the context id of the relevant message/statusbar
1287 /// ## `text`
1288 /// the message that was pushed
1289 #[doc(alias = "text-pushed")]
1290 fn connect_text_pushed<F: Fn(&Self, u32, &str) + 'static>(&self, f: F) -> SignalHandlerId {
1291 unsafe extern "C" fn text_pushed_trampoline<
1292 P: IsA<Statusbar>,
1293 F: Fn(&P, u32, &str) + 'static,
1294 >(
1295 this: *mut ffi::GtkStatusbar,
1296 context_id: std::ffi::c_uint,
1297 text: *mut std::ffi::c_char,
1298 f: glib::ffi::gpointer,
1299 ) {
1300 unsafe {
1301 let f: &F = &*(f as *const F);
1302 f(
1303 Statusbar::from_glib_borrow(this).unsafe_cast_ref(),
1304 context_id,
1305 &glib::GString::from_glib_borrow(text),
1306 )
1307 }
1308 }
1309 unsafe {
1310 let f: Box_<F> = Box_::new(f);
1311 connect_raw(
1312 self.as_ptr() as *mut _,
1313 c"text-pushed".as_ptr(),
1314 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1315 text_pushed_trampoline::<Self, F> as *const (),
1316 )),
1317 Box_::into_raw(f),
1318 )
1319 }
1320 }
1321}
1322
1323impl<O: IsA<Statusbar>> StatusbarExt for O {}