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