gtk4/auto/
combo_box.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4#![allow(deprecated)]
5
6use crate::{
7    ffi, Accessible, AccessibleRole, Align, Buildable, CellEditable, CellLayout, ConstraintTarget,
8    LayoutManager, Overflow, ScrollType, SensitivityType, TreeIter, TreeModel, Widget,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{connect_raw, SignalHandlerId},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// Use [`DropDown`][crate::DropDown] instead
20    /// A [`ComboBox`][crate::ComboBox] is a widget that allows the user to choose from a list of
21    /// valid choices.
22    ///
23    /// <picture>
24    ///   <source srcset="combo-box-dark.png" media="(prefers-color-scheme: dark)">
25    ///   <img alt="An example GtkComboBox" src="combo-box.png">
26    /// </picture>
27    ///
28    /// The [`ComboBox`][crate::ComboBox] displays the selected choice; when activated, the
29    /// [`ComboBox`][crate::ComboBox] displays a popup which allows the user to make a new choice.
30    ///
31    /// The [`ComboBox`][crate::ComboBox] uses the model-view pattern; the list of valid choices
32    /// is specified in the form of a tree model, and the display of the choices
33    /// can be adapted to the data in the model by using cell renderers, as you
34    /// would in a tree view. This is possible since [`ComboBox`][crate::ComboBox] implements the
35    /// [`CellLayout`][crate::CellLayout] interface. The tree model holding the valid
36    /// choices is not restricted to a flat list, it can be a real tree, and the
37    /// popup will reflect the tree structure.
38    ///
39    /// To allow the user to enter values not in the model, the
40    /// [`has-entry`][struct@crate::ComboBox#has-entry] property allows the [`ComboBox`][crate::ComboBox] to
41    /// contain a [`Entry`][crate::Entry]. This entry can be accessed by calling
42    /// [`ComboBoxExt::child()`][crate::prelude::ComboBoxExt::child()] on the combo box.
43    ///
44    /// For a simple list of textual choices, the model-view API of [`ComboBox`][crate::ComboBox]
45    /// can be a bit overwhelming. In this case, [`ComboBoxText`][crate::ComboBoxText] offers
46    /// a simple alternative. Both [`ComboBox`][crate::ComboBox] and [`ComboBoxText`][crate::ComboBoxText] can contain
47    /// an entry.
48    ///
49    /// ## CSS nodes
50    ///
51    /// ```text
52    /// combobox
53    /// ├── box.linked
54    /// │   ╰── button.combo
55    /// │       ╰── box
56    /// │           ├── cellview
57    /// │           ╰── arrow
58    /// ╰── window.popup
59    /// ```
60    ///
61    /// A normal combobox contains a box with the .linked class, a button
62    /// with the .combo class and inside those buttons, there are a cellview and
63    /// an arrow.
64    ///
65    /// ```text
66    /// combobox
67    /// ├── box.linked
68    /// │   ├── entry.combo
69    /// │   ╰── button.combo
70    /// │       ╰── box
71    /// │           ╰── arrow
72    /// ╰── window.popup
73    /// ```
74    ///
75    /// A [`ComboBox`][crate::ComboBox] with an entry has a single CSS node with name combobox.
76    /// It contains a box with the .linked class. That box contains an entry and
77    /// a button, both with the .combo class added. The button also contains another
78    /// node with name arrow.
79    ///
80    /// ## Accessibility
81    ///
82    /// [`ComboBox`][crate::ComboBox] uses the [enum@Gtk.AccessibleRole.combo_box] role.
83    ///
84    /// ## Properties
85    ///
86    ///
87    /// #### `active`
88    ///  The item which is currently active.
89    ///
90    /// If the model is a non-flat treemodel, and the active item is not an
91    /// immediate child of the root of the tree, this property has the value
92    /// `gtk_tree_path_get_indices (path)[0]`, where `path` is the
93    /// [`TreePath`][crate::TreePath] of the active item.
94    ///
95    /// Readable | Writeable
96    ///
97    ///
98    /// #### `active-id`
99    ///  The value of the ID column of the active row.
100    ///
101    /// Readable | Writeable
102    ///
103    ///
104    /// #### `button-sensitivity`
105    ///  Whether the dropdown button is sensitive when
106    /// the model is empty.
107    ///
108    /// Readable | Writeable
109    ///
110    ///
111    /// #### `child`
112    ///  The child widget.
113    ///
114    /// Readable | Writeable
115    ///
116    ///
117    /// #### `entry-text-column`
118    ///  The model column to associate with strings from the entry.
119    ///
120    /// This is property only relevant if the combo was created with
121    /// [`has-entry`][struct@crate::ComboBox#has-entry] is [`true`].
122    ///
123    /// Readable | Writeable
124    ///
125    ///
126    /// #### `has-entry`
127    ///  Whether the combo box has an entry.
128    ///
129    /// Readable | Writeable | Construct Only
130    ///
131    ///
132    /// #### `has-frame`
133    ///  The `has-frame` property controls whether a frame is drawn around the entry.
134    ///
135    /// Readable | Writeable
136    ///
137    ///
138    /// #### `id-column`
139    ///  The model column that provides string IDs for the values
140    /// in the model, if != -1.
141    ///
142    /// Readable | Writeable
143    ///
144    ///
145    /// #### `model`
146    ///  The model from which the combo box takes its values.
147    ///
148    /// Readable | Writeable
149    ///
150    ///
151    /// #### `popup-fixed-width`
152    ///  Whether the popup's width should be a fixed width matching the
153    /// allocated width of the combo box.
154    ///
155    /// Readable | Writeable
156    ///
157    ///
158    /// #### `popup-shown`
159    ///  Whether the combo boxes dropdown is popped up.
160    ///
161    /// Note that this property is mainly useful, because
162    /// it allows you to connect to notify::popup-shown.
163    ///
164    /// Readable
165    /// <details><summary><h4>Widget</h4></summary>
166    ///
167    ///
168    /// #### `can-focus`
169    ///  Whether the widget or any of its descendents can accept
170    /// the input focus.
171    ///
172    /// This property is meant to be set by widget implementations,
173    /// typically in their instance init function.
174    ///
175    /// Readable | Writeable
176    ///
177    ///
178    /// #### `can-target`
179    ///  Whether the widget can receive pointer events.
180    ///
181    /// Readable | Writeable
182    ///
183    ///
184    /// #### `css-classes`
185    ///  A list of css classes applied to this widget.
186    ///
187    /// Readable | Writeable
188    ///
189    ///
190    /// #### `css-name`
191    ///  The name of this widget in the CSS tree.
192    ///
193    /// This property is meant to be set by widget implementations,
194    /// typically in their instance init function.
195    ///
196    /// Readable | Writeable | Construct Only
197    ///
198    ///
199    /// #### `cursor`
200    ///  The cursor used by @widget.
201    ///
202    /// Readable | Writeable
203    ///
204    ///
205    /// #### `focus-on-click`
206    ///  Whether the widget should grab focus when it is clicked with the mouse.
207    ///
208    /// This property is only relevant for widgets that can take focus.
209    ///
210    /// Readable | Writeable
211    ///
212    ///
213    /// #### `focusable`
214    ///  Whether this widget itself will accept the input focus.
215    ///
216    /// Readable | Writeable
217    ///
218    ///
219    /// #### `halign`
220    ///  How to distribute horizontal space if widget gets extra space.
221    ///
222    /// Readable | Writeable
223    ///
224    ///
225    /// #### `has-default`
226    ///  Whether the widget is the default widget.
227    ///
228    /// Readable
229    ///
230    ///
231    /// #### `has-focus`
232    ///  Whether the widget has the input focus.
233    ///
234    /// Readable
235    ///
236    ///
237    /// #### `has-tooltip`
238    ///  Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
239    /// signal on @widget.
240    ///
241    /// A true value indicates that @widget can have a tooltip, in this case
242    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
243    /// determine whether it will provide a tooltip or not.
244    ///
245    /// Readable | Writeable
246    ///
247    ///
248    /// #### `height-request`
249    ///  Overrides for height request of the widget.
250    ///
251    /// If this is -1, the natural request will be used.
252    ///
253    /// Readable | Writeable
254    ///
255    ///
256    /// #### `hexpand`
257    ///  Whether to expand horizontally.
258    ///
259    /// Readable | Writeable
260    ///
261    ///
262    /// #### `hexpand-set`
263    ///  Whether to use the `hexpand` property.
264    ///
265    /// Readable | Writeable
266    ///
267    ///
268    /// #### `layout-manager`
269    ///  The [`LayoutManager`][crate::LayoutManager] instance to use to compute
270    /// the preferred size of the widget, and allocate its children.
271    ///
272    /// This property is meant to be set by widget implementations,
273    /// typically in their instance init function.
274    ///
275    /// Readable | Writeable
276    ///
277    ///
278    /// #### `limit-events`
279    ///  Makes this widget act like a modal dialog, with respect to
280    /// event delivery.
281    ///
282    /// Global event controllers will not handle events with targets
283    /// inside the widget, unless they are set up to ignore propagation
284    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
285    ///
286    /// Readable | Writeable
287    ///
288    ///
289    /// #### `margin-bottom`
290    ///  Margin on bottom side of widget.
291    ///
292    /// This property adds margin outside of the widget's normal size
293    /// request, the margin will be added in addition to the size from
294    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
295    ///
296    /// Readable | Writeable
297    ///
298    ///
299    /// #### `margin-end`
300    ///  Margin on end of widget, horizontally.
301    ///
302    /// This property supports left-to-right and right-to-left text
303    /// directions.
304    ///
305    /// This property adds margin outside of the widget's normal size
306    /// request, the margin will be added in addition to the size from
307    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
308    ///
309    /// Readable | Writeable
310    ///
311    ///
312    /// #### `margin-start`
313    ///  Margin on start of widget, horizontally.
314    ///
315    /// This property supports left-to-right and right-to-left text
316    /// directions.
317    ///
318    /// This property adds margin outside of the widget's normal size
319    /// request, the margin will be added in addition to the size from
320    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
321    ///
322    /// Readable | Writeable
323    ///
324    ///
325    /// #### `margin-top`
326    ///  Margin on top side of widget.
327    ///
328    /// This property adds margin outside of the widget's normal size
329    /// request, the margin will be added in addition to the size from
330    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
331    ///
332    /// Readable | Writeable
333    ///
334    ///
335    /// #### `name`
336    ///  The name of the widget.
337    ///
338    /// Readable | Writeable
339    ///
340    ///
341    /// #### `opacity`
342    ///  The requested opacity of the widget.
343    ///
344    /// Readable | Writeable
345    ///
346    ///
347    /// #### `overflow`
348    ///  How content outside the widget's content area is treated.
349    ///
350    /// This property is meant to be set by widget implementations,
351    /// typically in their instance init function.
352    ///
353    /// Readable | Writeable
354    ///
355    ///
356    /// #### `parent`
357    ///  The parent widget of this widget.
358    ///
359    /// Readable
360    ///
361    ///
362    /// #### `receives-default`
363    ///  Whether the widget will receive the default action when it is focused.
364    ///
365    /// Readable | Writeable
366    ///
367    ///
368    /// #### `root`
369    ///  The [`Root`][crate::Root] widget of the widget tree containing this widget.
370    ///
371    /// This will be `NULL` if the widget is not contained in a root widget.
372    ///
373    /// Readable
374    ///
375    ///
376    /// #### `scale-factor`
377    ///  The scale factor of the widget.
378    ///
379    /// Readable
380    ///
381    ///
382    /// #### `sensitive`
383    ///  Whether the widget responds to input.
384    ///
385    /// Readable | Writeable
386    ///
387    ///
388    /// #### `tooltip-markup`
389    ///  Sets the text of tooltip to be the given string, which is marked up
390    /// with Pango markup.
391    ///
392    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
393    ///
394    /// This is a convenience property which will take care of getting the
395    /// tooltip shown if the given string is not `NULL`:
396    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
397    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
398    /// the default signal handler.
399    ///
400    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
401    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
402    ///
403    /// Readable | Writeable
404    ///
405    ///
406    /// #### `tooltip-text`
407    ///  Sets the text of tooltip to be the given string.
408    ///
409    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
410    ///
411    /// This is a convenience property which will take care of getting the
412    /// tooltip shown if the given string is not `NULL`:
413    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
414    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
415    /// the default signal handler.
416    ///
417    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
418    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
419    ///
420    /// Readable | Writeable
421    ///
422    ///
423    /// #### `valign`
424    ///  How to distribute vertical space if widget gets extra space.
425    ///
426    /// Readable | Writeable
427    ///
428    ///
429    /// #### `vexpand`
430    ///  Whether to expand vertically.
431    ///
432    /// Readable | Writeable
433    ///
434    ///
435    /// #### `vexpand-set`
436    ///  Whether to use the `vexpand` property.
437    ///
438    /// Readable | Writeable
439    ///
440    ///
441    /// #### `visible`
442    ///  Whether the widget is visible.
443    ///
444    /// Readable | Writeable
445    ///
446    ///
447    /// #### `width-request`
448    ///  Overrides for width request of the widget.
449    ///
450    /// If this is -1, the natural request will be used.
451    ///
452    /// Readable | Writeable
453    /// </details>
454    /// <details><summary><h4>Accessible</h4></summary>
455    ///
456    ///
457    /// #### `accessible-role`
458    ///  The accessible role of the given [`Accessible`][crate::Accessible] implementation.
459    ///
460    /// The accessible role cannot be changed once set.
461    ///
462    /// Readable | Writeable
463    /// </details>
464    /// <details><summary><h4>CellEditable</h4></summary>
465    ///
466    ///
467    /// #### `editing-canceled`
468    ///  Indicates whether editing on the cell has been canceled.
469    ///
470    /// Readable | Writeable
471    /// </details>
472    ///
473    /// ## Signals
474    ///
475    ///
476    /// #### `activate`
477    ///  Emitted to when the combo box is activated.
478    ///
479    /// The `::activate` signal on [`ComboBox`][crate::ComboBox] is an action signal and
480    /// emitting it causes the combo box to pop up its dropdown.
481    ///
482    /// Action
483    ///
484    ///
485    /// #### `changed`
486    ///  Emitted when the active item is changed.
487    ///
488    /// The can be due to the user selecting a different item from the list,
489    /// or due to a call to [`ComboBoxExt::set_active_iter()`][crate::prelude::ComboBoxExt::set_active_iter()]. It will
490    /// also be emitted while typing into the entry of a combo box with an entry.
491    ///
492    ///
493    ///
494    ///
495    /// #### `format-entry-text`
496    ///  Emitted to allow changing how the text in a combo box's entry is displayed.
497    ///
498    /// See [`has-entry`][struct@crate::ComboBox#has-entry].
499    ///
500    /// Connect a signal handler which returns an allocated string representing
501    /// @path. That string will then be used to set the text in the combo box's
502    /// entry. The default signal handler uses the text from the
503    /// [`entry-text-column`][struct@crate::ComboBox#entry-text-column] model column.
504    ///
505    /// Here's an example signal handler which fetches data from the model and
506    /// displays it in the entry.
507    /// **⚠️ The following code is in c ⚠️**
508    ///
509    /// ```c
510    /// static char *
511    /// format_entry_text_callback (GtkComboBox *combo,
512    ///                             const char *path,
513    ///                             gpointer     user_data)
514    /// {
515    ///   GtkTreeIter iter;
516    ///   GtkTreeModel model;
517    ///   double       value;
518    ///
519    ///   model = gtk_combo_box_get_model (combo);
520    ///
521    ///   gtk_tree_model_get_iter_from_string (model, &iter, path);
522    ///   gtk_tree_model_get (model, &iter,
523    ///                       THE_DOUBLE_VALUE_COLUMN, &value,
524    ///                       -1);
525    ///
526    ///   return g_strdup_printf ("%g", value);
527    /// }
528    /// ```
529    ///
530    ///
531    ///
532    ///
533    /// #### `move-active`
534    ///  Emitted to move the active selection.
535    ///
536    /// This is an [keybinding signal](class.SignalAction.html).
537    ///
538    /// Action
539    ///
540    ///
541    /// #### `popdown`
542    ///  Emitted to popdown the combo box list.
543    ///
544    /// This is an [keybinding signal](class.SignalAction.html).
545    ///
546    /// The default bindings for this signal are Alt+Up and Escape.
547    ///
548    /// Action
549    ///
550    ///
551    /// #### `popup`
552    ///  Emitted to popup the combo box list.
553    ///
554    /// This is an [keybinding signal](class.SignalAction.html).
555    ///
556    /// The default binding for this signal is Alt+Down.
557    ///
558    /// Action
559    /// <details><summary><h4>Widget</h4></summary>
560    ///
561    ///
562    /// #### `destroy`
563    ///  Signals that all holders of a reference to the widget should release
564    /// the reference that they hold.
565    ///
566    /// May result in finalization of the widget if all references are released.
567    ///
568    /// This signal is not suitable for saving widget state.
569    ///
570    ///
571    ///
572    ///
573    /// #### `direction-changed`
574    ///  Emitted when the text direction of a widget changes.
575    ///
576    ///
577    ///
578    ///
579    /// #### `hide`
580    ///  Emitted when @widget is hidden.
581    ///
582    ///
583    ///
584    ///
585    /// #### `keynav-failed`
586    ///  Emitted if keyboard navigation fails.
587    ///
588    /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
589    ///
590    ///
591    ///
592    ///
593    /// #### `map`
594    ///  Emitted when @widget is going to be mapped.
595    ///
596    /// A widget is mapped when the widget is visible (which is controlled with
597    /// [`visible`][struct@crate::Widget#visible]) and all its parents up to the toplevel widget
598    /// are also visible.
599    ///
600    /// The `::map` signal can be used to determine whether a widget will be drawn,
601    /// for instance it can resume an animation that was stopped during the
602    /// emission of [`unmap`][struct@crate::Widget#unmap].
603    ///
604    ///
605    ///
606    ///
607    /// #### `mnemonic-activate`
608    ///  Emitted when a widget is activated via a mnemonic.
609    ///
610    /// The default handler for this signal activates @widget if @group_cycling
611    /// is false, or just makes @widget grab focus if @group_cycling is true.
612    ///
613    ///
614    ///
615    ///
616    /// #### `move-focus`
617    ///  Emitted when the focus is moved.
618    ///
619    /// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
620    ///
621    /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
622    /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
623    ///
624    /// Action
625    ///
626    ///
627    /// #### `query-tooltip`
628    ///  Emitted when the widget’s tooltip is about to be shown.
629    ///
630    /// This happens when the [`has-tooltip`][struct@crate::Widget#has-tooltip] property
631    /// is true and the hover timeout has expired with the cursor hovering
632    /// above @widget; or emitted when @widget got focus in keyboard mode.
633    ///
634    /// Using the given coordinates, the signal handler should determine
635    /// whether a tooltip should be shown for @widget. If this is the case
636    /// true should be returned, false otherwise. Note that if @keyboard_mode
637    /// is true, the values of @x and @y are undefined and should not be used.
638    ///
639    /// The signal handler is free to manipulate @tooltip with the therefore
640    /// destined function calls.
641    ///
642    ///
643    ///
644    ///
645    /// #### `realize`
646    ///  Emitted when @widget is associated with a [`gdk::Surface`][crate::gdk::Surface].
647    ///
648    /// This means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called
649    /// or the widget has been mapped (that is, it is going to be drawn).
650    ///
651    ///
652    ///
653    ///
654    /// #### `show`
655    ///  Emitted when @widget is shown.
656    ///
657    ///
658    ///
659    ///
660    /// #### `state-flags-changed`
661    ///  Emitted when the widget state changes.
662    ///
663    /// See [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
664    ///
665    ///
666    ///
667    ///
668    /// #### `unmap`
669    ///  Emitted when @widget is going to be unmapped.
670    ///
671    /// A widget is unmapped when either it or any of its parents up to the
672    /// toplevel widget have been set as hidden.
673    ///
674    /// As `::unmap` indicates that a widget will not be shown any longer,
675    /// it can be used to, for example, stop an animation on the widget.
676    ///
677    ///
678    ///
679    ///
680    /// #### `unrealize`
681    ///  Emitted when the [`gdk::Surface`][crate::gdk::Surface] associated with @widget is destroyed.
682    ///
683    /// This means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been called
684    /// or the widget has been unmapped (that is, it is going to be hidden).
685    ///
686    ///
687    /// </details>
688    /// <details><summary><h4>CellEditable</h4></summary>
689    ///
690    ///
691    /// #### `editing-done`
692    ///  This signal is a sign for the cell renderer to update its
693    /// value from the @cell_editable.
694    ///
695    /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
696    /// emitting this signal when they are done editing, e.g.
697    /// [`Entry`][crate::Entry] emits this signal when the user presses Enter. Typical things to
698    /// do in a handler for ::editing-done are to capture the edited value,
699    /// disconnect the @cell_editable from signals on the [`CellRenderer`][crate::CellRenderer], etc.
700    ///
701    /// gtk_cell_editable_editing_done() is a convenience method
702    /// for emitting `GtkCellEditable::editing-done`.
703    ///
704    ///
705    ///
706    ///
707    /// #### `remove-widget`
708    ///  This signal is meant to indicate that the cell is finished
709    /// editing, and the @cell_editable widget is being removed and may
710    /// subsequently be destroyed.
711    ///
712    /// Implementations of [`CellEditable`][crate::CellEditable] are responsible for
713    /// emitting this signal when they are done editing. It must
714    /// be emitted after the `GtkCellEditable::editing-done` signal,
715    /// to give the cell renderer a chance to update the cell's value
716    /// before the widget is removed.
717    ///
718    /// gtk_cell_editable_remove_widget() is a convenience method
719    /// for emitting `GtkCellEditable::remove-widget`.
720    ///
721    ///
722    /// </details>
723    ///
724    /// # Implements
725    ///
726    /// [`ComboBoxExt`][trait@crate::prelude::ComboBoxExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`CellEditableExt`][trait@crate::prelude::CellEditableExt], [`CellLayoutExt`][trait@crate::prelude::CellLayoutExt], [`ComboBoxExtManual`][trait@crate::prelude::ComboBoxExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual], [`CellLayoutExtManual`][trait@crate::prelude::CellLayoutExtManual]
727    #[doc(alias = "GtkComboBox")]
728    pub struct ComboBox(Object<ffi::GtkComboBox, ffi::GtkComboBoxClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, CellEditable, CellLayout;
729
730    match fn {
731        type_ => || ffi::gtk_combo_box_get_type(),
732    }
733}
734
735impl ComboBox {
736    pub const NONE: Option<&'static ComboBox> = None;
737
738    /// Creates a new empty [`ComboBox`][crate::ComboBox].
739    ///
740    /// # Deprecated since 4.10
741    ///
742    /// Use [`DropDown`][crate::DropDown]
743    ///
744    /// # Returns
745    ///
746    /// A new [`ComboBox`][crate::ComboBox]
747    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
748    #[allow(deprecated)]
749    #[doc(alias = "gtk_combo_box_new")]
750    pub fn new() -> ComboBox {
751        assert_initialized_main_thread!();
752        unsafe { Widget::from_glib_none(ffi::gtk_combo_box_new()).unsafe_cast() }
753    }
754
755    /// Creates a new empty [`ComboBox`][crate::ComboBox] with an entry.
756    ///
757    /// In order to use a combo box with entry, you need to tell it
758    /// which column of the model contains the text for the entry
759    /// by calling [`ComboBoxExt::set_entry_text_column()`][crate::prelude::ComboBoxExt::set_entry_text_column()].
760    ///
761    /// # Deprecated since 4.10
762    ///
763    /// Use [`DropDown`][crate::DropDown]
764    ///
765    /// # Returns
766    ///
767    /// A new [`ComboBox`][crate::ComboBox]
768    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
769    #[allow(deprecated)]
770    #[doc(alias = "gtk_combo_box_new_with_entry")]
771    #[doc(alias = "new_with_entry")]
772    pub fn with_entry() -> ComboBox {
773        assert_initialized_main_thread!();
774        unsafe { Widget::from_glib_none(ffi::gtk_combo_box_new_with_entry()).unsafe_cast() }
775    }
776
777    /// Creates a new [`ComboBox`][crate::ComboBox] with a model.
778    ///
779    /// # Deprecated since 4.10
780    ///
781    /// Use [`DropDown`][crate::DropDown]
782    /// ## `model`
783    /// a [`TreeModel`][crate::TreeModel]
784    ///
785    /// # Returns
786    ///
787    /// A new [`ComboBox`][crate::ComboBox]
788    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
789    #[allow(deprecated)]
790    #[doc(alias = "gtk_combo_box_new_with_model")]
791    #[doc(alias = "new_with_model")]
792    pub fn with_model(model: &impl IsA<TreeModel>) -> ComboBox {
793        skip_assert_initialized!();
794        unsafe {
795            Widget::from_glib_none(ffi::gtk_combo_box_new_with_model(
796                model.as_ref().to_glib_none().0,
797            ))
798            .unsafe_cast()
799        }
800    }
801
802    /// Creates a new empty [`ComboBox`][crate::ComboBox] with an entry and a model.
803    ///
804    /// See also [`with_entry()`][Self::with_entry()].
805    ///
806    /// # Deprecated since 4.10
807    ///
808    /// Use [`DropDown`][crate::DropDown]
809    /// ## `model`
810    /// A [`TreeModel`][crate::TreeModel]
811    ///
812    /// # Returns
813    ///
814    /// A new [`ComboBox`][crate::ComboBox]
815    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
816    #[allow(deprecated)]
817    #[doc(alias = "gtk_combo_box_new_with_model_and_entry")]
818    #[doc(alias = "new_with_model_and_entry")]
819    pub fn with_model_and_entry(model: &impl IsA<TreeModel>) -> ComboBox {
820        skip_assert_initialized!();
821        unsafe {
822            Widget::from_glib_none(ffi::gtk_combo_box_new_with_model_and_entry(
823                model.as_ref().to_glib_none().0,
824            ))
825            .unsafe_cast()
826        }
827    }
828
829    // rustdoc-stripper-ignore-next
830    /// Creates a new builder-pattern struct instance to construct [`ComboBox`] objects.
831    ///
832    /// This method returns an instance of [`ComboBoxBuilder`](crate::builders::ComboBoxBuilder) which can be used to create [`ComboBox`] objects.
833    pub fn builder() -> ComboBoxBuilder {
834        ComboBoxBuilder::new()
835    }
836}
837
838impl Default for ComboBox {
839    fn default() -> Self {
840        Self::new()
841    }
842}
843
844// rustdoc-stripper-ignore-next
845/// A [builder-pattern] type to construct [`ComboBox`] objects.
846///
847/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
848#[must_use = "The builder must be built to be used"]
849pub struct ComboBoxBuilder {
850    builder: glib::object::ObjectBuilder<'static, ComboBox>,
851}
852
853impl ComboBoxBuilder {
854    fn new() -> Self {
855        Self {
856            builder: glib::object::Object::builder(),
857        }
858    }
859
860    /// The item which is currently active.
861    ///
862    /// If the model is a non-flat treemodel, and the active item is not an
863    /// immediate child of the root of the tree, this property has the value
864    /// `gtk_tree_path_get_indices (path)[0]`, where `path` is the
865    /// [`TreePath`][crate::TreePath] of the active item.
866    pub fn active(self, active: i32) -> Self {
867        Self {
868            builder: self.builder.property("active", active),
869        }
870    }
871
872    /// The value of the ID column of the active row.
873    pub fn active_id(self, active_id: impl Into<glib::GString>) -> Self {
874        Self {
875            builder: self.builder.property("active-id", active_id.into()),
876        }
877    }
878
879    /// Whether the dropdown button is sensitive when
880    /// the model is empty.
881    pub fn button_sensitivity(self, button_sensitivity: SensitivityType) -> Self {
882        Self {
883            builder: self
884                .builder
885                .property("button-sensitivity", button_sensitivity),
886        }
887    }
888
889    /// The child widget.
890    pub fn child(self, child: &impl IsA<Widget>) -> Self {
891        Self {
892            builder: self.builder.property("child", child.clone().upcast()),
893        }
894    }
895
896    /// The model column to associate with strings from the entry.
897    ///
898    /// This is property only relevant if the combo was created with
899    /// [`has-entry`][struct@crate::ComboBox#has-entry] is [`true`].
900    pub fn entry_text_column(self, entry_text_column: i32) -> Self {
901        Self {
902            builder: self
903                .builder
904                .property("entry-text-column", entry_text_column),
905        }
906    }
907
908    /// Whether the combo box has an entry.
909    pub fn has_entry(self, has_entry: bool) -> Self {
910        Self {
911            builder: self.builder.property("has-entry", has_entry),
912        }
913    }
914
915    /// The `has-frame` property controls whether a frame is drawn around the entry.
916    pub fn has_frame(self, has_frame: bool) -> Self {
917        Self {
918            builder: self.builder.property("has-frame", has_frame),
919        }
920    }
921
922    /// The model column that provides string IDs for the values
923    /// in the model, if != -1.
924    pub fn id_column(self, id_column: i32) -> Self {
925        Self {
926            builder: self.builder.property("id-column", id_column),
927        }
928    }
929
930    /// The model from which the combo box takes its values.
931    pub fn model(self, model: &impl IsA<TreeModel>) -> Self {
932        Self {
933            builder: self.builder.property("model", model.clone().upcast()),
934        }
935    }
936
937    /// Whether the popup's width should be a fixed width matching the
938    /// allocated width of the combo box.
939    pub fn popup_fixed_width(self, popup_fixed_width: bool) -> Self {
940        Self {
941            builder: self
942                .builder
943                .property("popup-fixed-width", popup_fixed_width),
944        }
945    }
946
947    /// Whether the widget or any of its descendents can accept
948    /// the input focus.
949    ///
950    /// This property is meant to be set by widget implementations,
951    /// typically in their instance init function.
952    pub fn can_focus(self, can_focus: bool) -> Self {
953        Self {
954            builder: self.builder.property("can-focus", can_focus),
955        }
956    }
957
958    /// Whether the widget can receive pointer events.
959    pub fn can_target(self, can_target: bool) -> Self {
960        Self {
961            builder: self.builder.property("can-target", can_target),
962        }
963    }
964
965    /// A list of css classes applied to this widget.
966    pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
967        Self {
968            builder: self.builder.property("css-classes", css_classes.into()),
969        }
970    }
971
972    /// The name of this widget in the CSS tree.
973    ///
974    /// This property is meant to be set by widget implementations,
975    /// typically in their instance init function.
976    pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
977        Self {
978            builder: self.builder.property("css-name", css_name.into()),
979        }
980    }
981
982    /// The cursor used by @widget.
983    pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
984        Self {
985            builder: self.builder.property("cursor", cursor.clone()),
986        }
987    }
988
989    /// Whether the widget should grab focus when it is clicked with the mouse.
990    ///
991    /// This property is only relevant for widgets that can take focus.
992    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
993        Self {
994            builder: self.builder.property("focus-on-click", focus_on_click),
995        }
996    }
997
998    /// Whether this widget itself will accept the input focus.
999    pub fn focusable(self, focusable: bool) -> Self {
1000        Self {
1001            builder: self.builder.property("focusable", focusable),
1002        }
1003    }
1004
1005    /// How to distribute horizontal space if widget gets extra space.
1006    pub fn halign(self, halign: Align) -> Self {
1007        Self {
1008            builder: self.builder.property("halign", halign),
1009        }
1010    }
1011
1012    /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
1013    /// signal on @widget.
1014    ///
1015    /// A true value indicates that @widget can have a tooltip, in this case
1016    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
1017    /// determine whether it will provide a tooltip or not.
1018    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1019        Self {
1020            builder: self.builder.property("has-tooltip", has_tooltip),
1021        }
1022    }
1023
1024    /// Overrides for height request of the widget.
1025    ///
1026    /// If this is -1, the natural request will be used.
1027    pub fn height_request(self, height_request: i32) -> Self {
1028        Self {
1029            builder: self.builder.property("height-request", height_request),
1030        }
1031    }
1032
1033    /// Whether to expand horizontally.
1034    pub fn hexpand(self, hexpand: bool) -> Self {
1035        Self {
1036            builder: self.builder.property("hexpand", hexpand),
1037        }
1038    }
1039
1040    /// Whether to use the `hexpand` property.
1041    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1042        Self {
1043            builder: self.builder.property("hexpand-set", hexpand_set),
1044        }
1045    }
1046
1047    /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
1048    /// the preferred size of the widget, and allocate its children.
1049    ///
1050    /// This property is meant to be set by widget implementations,
1051    /// typically in their instance init function.
1052    pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
1053        Self {
1054            builder: self
1055                .builder
1056                .property("layout-manager", layout_manager.clone().upcast()),
1057        }
1058    }
1059
1060    /// Makes this widget act like a modal dialog, with respect to
1061    /// event delivery.
1062    ///
1063    /// Global event controllers will not handle events with targets
1064    /// inside the widget, unless they are set up to ignore propagation
1065    /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
1066    #[cfg(feature = "v4_18")]
1067    #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
1068    pub fn limit_events(self, limit_events: bool) -> Self {
1069        Self {
1070            builder: self.builder.property("limit-events", limit_events),
1071        }
1072    }
1073
1074    /// Margin on bottom side of widget.
1075    ///
1076    /// This property adds margin outside of the widget's normal size
1077    /// request, the margin will be added in addition to the size from
1078    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1079    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1080        Self {
1081            builder: self.builder.property("margin-bottom", margin_bottom),
1082        }
1083    }
1084
1085    /// Margin on end of widget, horizontally.
1086    ///
1087    /// This property supports left-to-right and right-to-left text
1088    /// directions.
1089    ///
1090    /// This property adds margin outside of the widget's normal size
1091    /// request, the margin will be added in addition to the size from
1092    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1093    pub fn margin_end(self, margin_end: i32) -> Self {
1094        Self {
1095            builder: self.builder.property("margin-end", margin_end),
1096        }
1097    }
1098
1099    /// Margin on start of widget, horizontally.
1100    ///
1101    /// This property supports left-to-right and right-to-left text
1102    /// directions.
1103    ///
1104    /// This property adds margin outside of the widget's normal size
1105    /// request, the margin will be added in addition to the size from
1106    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1107    pub fn margin_start(self, margin_start: i32) -> Self {
1108        Self {
1109            builder: self.builder.property("margin-start", margin_start),
1110        }
1111    }
1112
1113    /// Margin on top side of widget.
1114    ///
1115    /// This property adds margin outside of the widget's normal size
1116    /// request, the margin will be added in addition to the size from
1117    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1118    pub fn margin_top(self, margin_top: i32) -> Self {
1119        Self {
1120            builder: self.builder.property("margin-top", margin_top),
1121        }
1122    }
1123
1124    /// The name of the widget.
1125    pub fn name(self, name: impl Into<glib::GString>) -> Self {
1126        Self {
1127            builder: self.builder.property("name", name.into()),
1128        }
1129    }
1130
1131    /// The requested opacity of the widget.
1132    pub fn opacity(self, opacity: f64) -> Self {
1133        Self {
1134            builder: self.builder.property("opacity", opacity),
1135        }
1136    }
1137
1138    /// How content outside the widget's content area is treated.
1139    ///
1140    /// This property is meant to be set by widget implementations,
1141    /// typically in their instance init function.
1142    pub fn overflow(self, overflow: Overflow) -> Self {
1143        Self {
1144            builder: self.builder.property("overflow", overflow),
1145        }
1146    }
1147
1148    /// Whether the widget will receive the default action when it is focused.
1149    pub fn receives_default(self, receives_default: bool) -> Self {
1150        Self {
1151            builder: self.builder.property("receives-default", receives_default),
1152        }
1153    }
1154
1155    /// Whether the widget responds to input.
1156    pub fn sensitive(self, sensitive: bool) -> Self {
1157        Self {
1158            builder: self.builder.property("sensitive", sensitive),
1159        }
1160    }
1161
1162    /// Sets the text of tooltip to be the given string, which is marked up
1163    /// with Pango markup.
1164    ///
1165    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1166    ///
1167    /// This is a convenience property which will take care of getting the
1168    /// tooltip shown if the given string is not `NULL`:
1169    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1170    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1171    /// the default signal handler.
1172    ///
1173    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1174    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1175    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1176        Self {
1177            builder: self
1178                .builder
1179                .property("tooltip-markup", tooltip_markup.into()),
1180        }
1181    }
1182
1183    /// Sets the text of tooltip to be the given string.
1184    ///
1185    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1186    ///
1187    /// This is a convenience property which will take care of getting the
1188    /// tooltip shown if the given string is not `NULL`:
1189    /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1190    /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1191    /// the default signal handler.
1192    ///
1193    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1194    /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1195    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1196        Self {
1197            builder: self.builder.property("tooltip-text", tooltip_text.into()),
1198        }
1199    }
1200
1201    /// How to distribute vertical space if widget gets extra space.
1202    pub fn valign(self, valign: Align) -> Self {
1203        Self {
1204            builder: self.builder.property("valign", valign),
1205        }
1206    }
1207
1208    /// Whether to expand vertically.
1209    pub fn vexpand(self, vexpand: bool) -> Self {
1210        Self {
1211            builder: self.builder.property("vexpand", vexpand),
1212        }
1213    }
1214
1215    /// Whether to use the `vexpand` property.
1216    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1217        Self {
1218            builder: self.builder.property("vexpand-set", vexpand_set),
1219        }
1220    }
1221
1222    /// Whether the widget is visible.
1223    pub fn visible(self, visible: bool) -> Self {
1224        Self {
1225            builder: self.builder.property("visible", visible),
1226        }
1227    }
1228
1229    /// Overrides for width request of the widget.
1230    ///
1231    /// If this is -1, the natural request will be used.
1232    pub fn width_request(self, width_request: i32) -> Self {
1233        Self {
1234            builder: self.builder.property("width-request", width_request),
1235        }
1236    }
1237
1238    /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
1239    ///
1240    /// The accessible role cannot be changed once set.
1241    pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
1242        Self {
1243            builder: self.builder.property("accessible-role", accessible_role),
1244        }
1245    }
1246
1247    /// Indicates whether editing on the cell has been canceled.
1248    pub fn editing_canceled(self, editing_canceled: bool) -> Self {
1249        Self {
1250            builder: self.builder.property("editing-canceled", editing_canceled),
1251        }
1252    }
1253
1254    // rustdoc-stripper-ignore-next
1255    /// Build the [`ComboBox`].
1256    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1257    pub fn build(self) -> ComboBox {
1258        assert_initialized_main_thread!();
1259        self.builder.build()
1260    }
1261}
1262
1263/// Trait containing all [`struct@ComboBox`] methods.
1264///
1265/// # Implementors
1266///
1267/// [`ComboBoxText`][struct@crate::ComboBoxText], [`ComboBox`][struct@crate::ComboBox]
1268pub trait ComboBoxExt: IsA<ComboBox> + 'static {
1269    /// Returns the ID of the active row of @self.
1270    ///
1271    /// This value is taken from the active row and the column specified
1272    /// by the [`id-column`][struct@crate::ComboBox#id-column] property of @self
1273    /// (see [`set_id_column()`][Self::set_id_column()]).
1274    ///
1275    /// The returned value is an interned string which means that you can
1276    /// compare the pointer by value to other interned strings and that you
1277    /// must not free it.
1278    ///
1279    /// If the [`id-column`][struct@crate::ComboBox#id-column] property of @self is
1280    /// not set, or if no row is active, or if the active row has a [`None`]
1281    /// ID value, then [`None`] is returned.
1282    ///
1283    /// # Deprecated since 4.10
1284    ///
1285    /// Use [`DropDown`][crate::DropDown]
1286    ///
1287    /// # Returns
1288    ///
1289    /// the ID of the active row
1290    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1291    #[allow(deprecated)]
1292    #[doc(alias = "gtk_combo_box_get_active_id")]
1293    #[doc(alias = "get_active_id")]
1294    #[doc(alias = "active-id")]
1295    fn active_id(&self) -> Option<glib::GString> {
1296        unsafe {
1297            from_glib_none(ffi::gtk_combo_box_get_active_id(
1298                self.as_ref().to_glib_none().0,
1299            ))
1300        }
1301    }
1302
1303    /// Sets @iter to point to the currently active item.
1304    ///
1305    /// If no item is active, @iter is left unchanged.
1306    ///
1307    /// # Deprecated since 4.10
1308    ///
1309    /// Use [`DropDown`][crate::DropDown]
1310    ///
1311    /// # Returns
1312    ///
1313    /// [`true`] if @iter was set, [`false`] otherwise
1314    ///
1315    /// ## `iter`
1316    /// A [`TreeIter`][crate::TreeIter]
1317    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1318    #[allow(deprecated)]
1319    #[doc(alias = "gtk_combo_box_get_active_iter")]
1320    #[doc(alias = "get_active_iter")]
1321    fn active_iter(&self) -> Option<TreeIter> {
1322        unsafe {
1323            let mut iter = TreeIter::uninitialized();
1324            let ret = from_glib(ffi::gtk_combo_box_get_active_iter(
1325                self.as_ref().to_glib_none().0,
1326                iter.to_glib_none_mut().0,
1327            ));
1328            if ret {
1329                Some(iter)
1330            } else {
1331                None
1332            }
1333        }
1334    }
1335
1336    /// Returns whether the combo box sets the dropdown button
1337    /// sensitive or not when there are no items in the model.
1338    ///
1339    /// # Deprecated since 4.10
1340    ///
1341    /// Use [`DropDown`][crate::DropDown]
1342    ///
1343    /// # Returns
1344    ///
1345    /// [`SensitivityType::On`][crate::SensitivityType::On] if the dropdown button
1346    ///   is sensitive when the model is empty, [`SensitivityType::Off`][crate::SensitivityType::Off]
1347    ///   if the button is always insensitive or [`SensitivityType::Auto`][crate::SensitivityType::Auto]
1348    ///   if it is only sensitive as long as the model has one item to
1349    ///   be selected.
1350    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1351    #[allow(deprecated)]
1352    #[doc(alias = "gtk_combo_box_get_button_sensitivity")]
1353    #[doc(alias = "get_button_sensitivity")]
1354    #[doc(alias = "button-sensitivity")]
1355    fn button_sensitivity(&self) -> SensitivityType {
1356        unsafe {
1357            from_glib(ffi::gtk_combo_box_get_button_sensitivity(
1358                self.as_ref().to_glib_none().0,
1359            ))
1360        }
1361    }
1362
1363    /// Gets the child widget of @self.
1364    ///
1365    /// # Deprecated since 4.10
1366    ///
1367    /// Use [`DropDown`][crate::DropDown]
1368    ///
1369    /// # Returns
1370    ///
1371    /// the child widget of @self
1372    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1373    #[allow(deprecated)]
1374    #[doc(alias = "gtk_combo_box_get_child")]
1375    #[doc(alias = "get_child")]
1376    fn child(&self) -> Option<Widget> {
1377        unsafe { from_glib_none(ffi::gtk_combo_box_get_child(self.as_ref().to_glib_none().0)) }
1378    }
1379
1380    /// Returns the column which @self is using to get the strings
1381    /// from to display in the internal entry.
1382    ///
1383    /// # Deprecated since 4.10
1384    ///
1385    /// Use [`DropDown`][crate::DropDown]
1386    ///
1387    /// # Returns
1388    ///
1389    /// A column in the data source model of @self.
1390    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1391    #[allow(deprecated)]
1392    #[doc(alias = "gtk_combo_box_get_entry_text_column")]
1393    #[doc(alias = "get_entry_text_column")]
1394    #[doc(alias = "entry-text-column")]
1395    fn entry_text_column(&self) -> i32 {
1396        unsafe { ffi::gtk_combo_box_get_entry_text_column(self.as_ref().to_glib_none().0) }
1397    }
1398
1399    /// Returns whether the combo box has an entry.
1400    ///
1401    /// # Deprecated since 4.10
1402    ///
1403    /// Use [`DropDown`][crate::DropDown]
1404    ///
1405    /// # Returns
1406    ///
1407    /// whether there is an entry in @self.
1408    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1409    #[allow(deprecated)]
1410    #[doc(alias = "gtk_combo_box_get_has_entry")]
1411    #[doc(alias = "get_has_entry")]
1412    #[doc(alias = "has-entry")]
1413    fn has_entry(&self) -> bool {
1414        unsafe {
1415            from_glib(ffi::gtk_combo_box_get_has_entry(
1416                self.as_ref().to_glib_none().0,
1417            ))
1418        }
1419    }
1420
1421    /// Returns the column which @self is using to get string IDs
1422    /// for values from.
1423    ///
1424    /// # Deprecated since 4.10
1425    ///
1426    /// Use [`DropDown`][crate::DropDown]
1427    ///
1428    /// # Returns
1429    ///
1430    /// A column in the data source model of @self.
1431    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1432    #[allow(deprecated)]
1433    #[doc(alias = "gtk_combo_box_get_id_column")]
1434    #[doc(alias = "get_id_column")]
1435    #[doc(alias = "id-column")]
1436    fn id_column(&self) -> i32 {
1437        unsafe { ffi::gtk_combo_box_get_id_column(self.as_ref().to_glib_none().0) }
1438    }
1439
1440    /// Returns the [`TreeModel`][crate::TreeModel] of @self.
1441    ///
1442    /// # Deprecated since 4.10
1443    ///
1444    /// Use [`DropDown`][crate::DropDown]
1445    ///
1446    /// # Returns
1447    ///
1448    /// A [`TreeModel`][crate::TreeModel] which was passed
1449    ///   during construction.
1450    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1451    #[allow(deprecated)]
1452    #[doc(alias = "gtk_combo_box_get_model")]
1453    #[doc(alias = "get_model")]
1454    fn model(&self) -> Option<TreeModel> {
1455        unsafe { from_glib_none(ffi::gtk_combo_box_get_model(self.as_ref().to_glib_none().0)) }
1456    }
1457
1458    /// Gets whether the popup uses a fixed width.
1459    ///
1460    /// # Deprecated since 4.10
1461    ///
1462    /// Use [`DropDown`][crate::DropDown]
1463    ///
1464    /// # Returns
1465    ///
1466    /// [`true`] if the popup uses a fixed width
1467    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1468    #[allow(deprecated)]
1469    #[doc(alias = "gtk_combo_box_get_popup_fixed_width")]
1470    #[doc(alias = "get_popup_fixed_width")]
1471    #[doc(alias = "popup-fixed-width")]
1472    fn is_popup_fixed_width(&self) -> bool {
1473        unsafe {
1474            from_glib(ffi::gtk_combo_box_get_popup_fixed_width(
1475                self.as_ref().to_glib_none().0,
1476            ))
1477        }
1478    }
1479
1480    /// Hides the menu or dropdown list of @self.
1481    ///
1482    /// This function is mostly intended for use by accessibility technologies;
1483    /// applications should have little use for it.
1484    ///
1485    /// # Deprecated since 4.10
1486    ///
1487    /// Use [`DropDown`][crate::DropDown]
1488    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1489    #[allow(deprecated)]
1490    #[doc(alias = "gtk_combo_box_popdown")]
1491    fn popdown(&self) {
1492        unsafe {
1493            ffi::gtk_combo_box_popdown(self.as_ref().to_glib_none().0);
1494        }
1495    }
1496
1497    /// Pops up the menu or dropdown list of @self.
1498    ///
1499    /// This function is mostly intended for use by accessibility technologies;
1500    /// applications should have little use for it.
1501    ///
1502    /// Before calling this, @self must be mapped, or nothing will happen.
1503    ///
1504    /// # Deprecated since 4.10
1505    ///
1506    /// Use [`DropDown`][crate::DropDown]
1507    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1508    #[allow(deprecated)]
1509    #[doc(alias = "gtk_combo_box_popup")]
1510    fn popup(&self) {
1511        unsafe {
1512            ffi::gtk_combo_box_popup(self.as_ref().to_glib_none().0);
1513        }
1514    }
1515
1516    /// Pops up the menu of @self.
1517    ///
1518    /// Note that currently this does not do anything with the device, as it was
1519    /// previously only used for list-mode combo boxes, and those were removed
1520    /// in GTK 4. However, it is retained in case similar functionality is added
1521    /// back later.
1522    ///
1523    /// # Deprecated since 4.10
1524    ///
1525    /// Use [`DropDown`][crate::DropDown]
1526    /// ## `device`
1527    /// a [`gdk::Device`][crate::gdk::Device]
1528    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1529    #[allow(deprecated)]
1530    #[doc(alias = "gtk_combo_box_popup_for_device")]
1531    fn popup_for_device(&self, device: &gdk::Device) {
1532        unsafe {
1533            ffi::gtk_combo_box_popup_for_device(
1534                self.as_ref().to_glib_none().0,
1535                device.to_glib_none().0,
1536            );
1537        }
1538    }
1539
1540    /// Changes the active row of @self to the one that has an ID equal to
1541    /// @active_id.
1542    ///
1543    /// If @active_id is [`None`], the active row is unset. Rows having
1544    /// a [`None`] ID string cannot be made active by this function.
1545    ///
1546    /// If the [`id-column`][struct@crate::ComboBox#id-column] property of @self is
1547    /// unset or if no row has the given ID then the function does nothing
1548    /// and returns [`false`].
1549    ///
1550    /// # Deprecated since 4.10
1551    ///
1552    /// Use [`DropDown`][crate::DropDown]
1553    /// ## `active_id`
1554    /// the ID of the row to select
1555    ///
1556    /// # Returns
1557    ///
1558    /// [`true`] if a row with a matching ID was found. If a [`None`]
1559    ///   @active_id was given to unset the active row, the function
1560    ///   always returns [`true`].
1561    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1562    #[allow(deprecated)]
1563    #[doc(alias = "gtk_combo_box_set_active_id")]
1564    #[doc(alias = "active-id")]
1565    fn set_active_id(&self, active_id: Option<&str>) -> bool {
1566        unsafe {
1567            from_glib(ffi::gtk_combo_box_set_active_id(
1568                self.as_ref().to_glib_none().0,
1569                active_id.to_glib_none().0,
1570            ))
1571        }
1572    }
1573
1574    /// Sets the current active item to be the one referenced by @iter.
1575    ///
1576    /// If @iter is [`None`], the active item is unset.
1577    ///
1578    /// # Deprecated since 4.10
1579    ///
1580    /// Use [`DropDown`][crate::DropDown]
1581    /// ## `iter`
1582    /// The [`TreeIter`][crate::TreeIter]
1583    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1584    #[allow(deprecated)]
1585    #[doc(alias = "gtk_combo_box_set_active_iter")]
1586    fn set_active_iter(&self, iter: Option<&TreeIter>) {
1587        unsafe {
1588            ffi::gtk_combo_box_set_active_iter(
1589                self.as_ref().to_glib_none().0,
1590                mut_override(iter.to_glib_none().0),
1591            );
1592        }
1593    }
1594
1595    /// Sets whether the dropdown button of the combo box should update
1596    /// its sensitivity depending on the model contents.
1597    ///
1598    /// # Deprecated since 4.10
1599    ///
1600    /// Use [`DropDown`][crate::DropDown]
1601    /// ## `sensitivity`
1602    /// specify the sensitivity of the dropdown button
1603    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1604    #[allow(deprecated)]
1605    #[doc(alias = "gtk_combo_box_set_button_sensitivity")]
1606    #[doc(alias = "button-sensitivity")]
1607    fn set_button_sensitivity(&self, sensitivity: SensitivityType) {
1608        unsafe {
1609            ffi::gtk_combo_box_set_button_sensitivity(
1610                self.as_ref().to_glib_none().0,
1611                sensitivity.into_glib(),
1612            );
1613        }
1614    }
1615
1616    /// Sets the child widget of @self.
1617    ///
1618    /// # Deprecated since 4.10
1619    ///
1620    /// Use [`DropDown`][crate::DropDown]
1621    /// ## `child`
1622    /// the child widget
1623    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1624    #[allow(deprecated)]
1625    #[doc(alias = "gtk_combo_box_set_child")]
1626    #[doc(alias = "child")]
1627    fn set_child(&self, child: Option<&impl IsA<Widget>>) {
1628        unsafe {
1629            ffi::gtk_combo_box_set_child(
1630                self.as_ref().to_glib_none().0,
1631                child.map(|p| p.as_ref()).to_glib_none().0,
1632            );
1633        }
1634    }
1635
1636    /// Sets the model column which @self should use to get strings
1637    /// from to be @text_column.
1638    ///
1639    /// For this column no separate
1640    /// [`CellRenderer`][crate::CellRenderer] is needed.
1641    ///
1642    /// The column @text_column in the model of @self must be of
1643    /// type `G_TYPE_STRING`.
1644    ///
1645    /// This is only relevant if @self has been created with
1646    /// [`has-entry`][struct@crate::ComboBox#has-entry] as [`true`].
1647    ///
1648    /// # Deprecated since 4.10
1649    ///
1650    /// Use [`DropDown`][crate::DropDown]
1651    /// ## `text_column`
1652    /// A column in @model to get the strings from for
1653    ///   the internal entry
1654    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1655    #[allow(deprecated)]
1656    #[doc(alias = "gtk_combo_box_set_entry_text_column")]
1657    #[doc(alias = "entry-text-column")]
1658    fn set_entry_text_column(&self, text_column: i32) {
1659        unsafe {
1660            ffi::gtk_combo_box_set_entry_text_column(self.as_ref().to_glib_none().0, text_column);
1661        }
1662    }
1663
1664    /// Sets the model column which @self should use to get string IDs
1665    /// for values from.
1666    ///
1667    /// The column @id_column in the model of @self must be of type
1668    /// `G_TYPE_STRING`.
1669    ///
1670    /// # Deprecated since 4.10
1671    ///
1672    /// Use [`DropDown`][crate::DropDown]
1673    /// ## `id_column`
1674    /// A column in @model to get string IDs for values from
1675    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1676    #[allow(deprecated)]
1677    #[doc(alias = "gtk_combo_box_set_id_column")]
1678    #[doc(alias = "id-column")]
1679    fn set_id_column(&self, id_column: i32) {
1680        unsafe {
1681            ffi::gtk_combo_box_set_id_column(self.as_ref().to_glib_none().0, id_column);
1682        }
1683    }
1684
1685    /// Sets the model used by @self to be @model.
1686    ///
1687    /// Will unset a previously set model (if applicable). If model is [`None`],
1688    /// then it will unset the model.
1689    ///
1690    /// Note that this function does not clear the cell renderers, you have to
1691    /// call [`CellLayoutExt::clear()`][crate::prelude::CellLayoutExt::clear()] yourself if you need to set up different
1692    /// cell renderers for the new model.
1693    ///
1694    /// # Deprecated since 4.10
1695    ///
1696    /// Use [`DropDown`][crate::DropDown]
1697    /// ## `model`
1698    /// A [`TreeModel`][crate::TreeModel]
1699    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1700    #[allow(deprecated)]
1701    #[doc(alias = "gtk_combo_box_set_model")]
1702    #[doc(alias = "model")]
1703    fn set_model(&self, model: Option<&impl IsA<TreeModel>>) {
1704        unsafe {
1705            ffi::gtk_combo_box_set_model(
1706                self.as_ref().to_glib_none().0,
1707                model.map(|p| p.as_ref()).to_glib_none().0,
1708            );
1709        }
1710    }
1711
1712    /// Specifies whether the popup’s width should be a fixed width.
1713    ///
1714    /// If @fixed is [`true`], the popup's width is set to match the
1715    /// allocated width of the combo box.
1716    ///
1717    /// # Deprecated since 4.10
1718    ///
1719    /// Use [`DropDown`][crate::DropDown]
1720    /// ## `fixed`
1721    /// whether to use a fixed popup width
1722    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1723    #[allow(deprecated)]
1724    #[doc(alias = "gtk_combo_box_set_popup_fixed_width")]
1725    #[doc(alias = "popup-fixed-width")]
1726    fn set_popup_fixed_width(&self, fixed: bool) {
1727        unsafe {
1728            ffi::gtk_combo_box_set_popup_fixed_width(
1729                self.as_ref().to_glib_none().0,
1730                fixed.into_glib(),
1731            );
1732        }
1733    }
1734
1735    /// Sets the row separator function, which is used to determine
1736    /// whether a row should be drawn as a separator.
1737    ///
1738    /// If the row separator function is [`None`], no separators are drawn.
1739    /// This is the default value.
1740    ///
1741    /// # Deprecated since 4.10
1742    ///
1743    /// Use [`DropDown`][crate::DropDown]
1744    /// ## `func`
1745    /// a `GtkTreeViewRowSeparatorFunc`
1746    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1747    #[allow(deprecated)]
1748    #[doc(alias = "gtk_combo_box_set_row_separator_func")]
1749    fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(&self, func: P) {
1750        let func_data: Box_<P> = Box_::new(func);
1751        unsafe extern "C" fn func_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(
1752            model: *mut ffi::GtkTreeModel,
1753            iter: *mut ffi::GtkTreeIter,
1754            data: glib::ffi::gpointer,
1755        ) -> glib::ffi::gboolean {
1756            let model = from_glib_borrow(model);
1757            let iter = from_glib_borrow(iter);
1758            let callback = &*(data as *mut P);
1759            (*callback)(&model, &iter).into_glib()
1760        }
1761        let func = Some(func_func::<P> as _);
1762        unsafe extern "C" fn destroy_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(
1763            data: glib::ffi::gpointer,
1764        ) {
1765            let _callback = Box_::from_raw(data as *mut P);
1766        }
1767        let destroy_call3 = Some(destroy_func::<P> as _);
1768        let super_callback0: Box_<P> = func_data;
1769        unsafe {
1770            ffi::gtk_combo_box_set_row_separator_func(
1771                self.as_ref().to_glib_none().0,
1772                func,
1773                Box_::into_raw(super_callback0) as *mut _,
1774                destroy_call3,
1775            );
1776        }
1777    }
1778
1779    /// The `has-frame` property controls whether a frame is drawn around the entry.
1780    #[doc(alias = "has-frame")]
1781    fn has_frame(&self) -> bool {
1782        ObjectExt::property(self.as_ref(), "has-frame")
1783    }
1784
1785    /// The `has-frame` property controls whether a frame is drawn around the entry.
1786    #[doc(alias = "has-frame")]
1787    fn set_has_frame(&self, has_frame: bool) {
1788        ObjectExt::set_property(self.as_ref(), "has-frame", has_frame)
1789    }
1790
1791    /// Whether the combo boxes dropdown is popped up.
1792    ///
1793    /// Note that this property is mainly useful, because
1794    /// it allows you to connect to notify::popup-shown.
1795    #[doc(alias = "popup-shown")]
1796    fn is_popup_shown(&self) -> bool {
1797        ObjectExt::property(self.as_ref(), "popup-shown")
1798    }
1799
1800    /// Emitted to when the combo box is activated.
1801    ///
1802    /// The `::activate` signal on [`ComboBox`][crate::ComboBox] is an action signal and
1803    /// emitting it causes the combo box to pop up its dropdown.
1804    #[cfg(feature = "v4_6")]
1805    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1806    #[doc(alias = "activate")]
1807    fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1808        unsafe extern "C" fn activate_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
1809            this: *mut ffi::GtkComboBox,
1810            f: glib::ffi::gpointer,
1811        ) {
1812            let f: &F = &*(f as *const F);
1813            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
1814        }
1815        unsafe {
1816            let f: Box_<F> = Box_::new(f);
1817            connect_raw(
1818                self.as_ptr() as *mut _,
1819                c"activate".as_ptr() as *const _,
1820                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1821                    activate_trampoline::<Self, F> as *const (),
1822                )),
1823                Box_::into_raw(f),
1824            )
1825        }
1826    }
1827
1828    #[cfg(feature = "v4_6")]
1829    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1830    fn emit_activate(&self) {
1831        self.emit_by_name::<()>("activate", &[]);
1832    }
1833
1834    /// Emitted when the active item is changed.
1835    ///
1836    /// The can be due to the user selecting a different item from the list,
1837    /// or due to a call to [`set_active_iter()`][Self::set_active_iter()]. It will
1838    /// also be emitted while typing into the entry of a combo box with an entry.
1839    #[doc(alias = "changed")]
1840    fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1841        unsafe extern "C" fn changed_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
1842            this: *mut ffi::GtkComboBox,
1843            f: glib::ffi::gpointer,
1844        ) {
1845            let f: &F = &*(f as *const F);
1846            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
1847        }
1848        unsafe {
1849            let f: Box_<F> = Box_::new(f);
1850            connect_raw(
1851                self.as_ptr() as *mut _,
1852                c"changed".as_ptr() as *const _,
1853                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1854                    changed_trampoline::<Self, F> as *const (),
1855                )),
1856                Box_::into_raw(f),
1857            )
1858        }
1859    }
1860
1861    /// Emitted to allow changing how the text in a combo box's entry is displayed.
1862    ///
1863    /// See [`has-entry`][struct@crate::ComboBox#has-entry].
1864    ///
1865    /// Connect a signal handler which returns an allocated string representing
1866    /// @path. That string will then be used to set the text in the combo box's
1867    /// entry. The default signal handler uses the text from the
1868    /// [`entry-text-column`][struct@crate::ComboBox#entry-text-column] model column.
1869    ///
1870    /// Here's an example signal handler which fetches data from the model and
1871    /// displays it in the entry.
1872    /// **⚠️ The following code is in c ⚠️**
1873    ///
1874    /// ```c
1875    /// static char *
1876    /// format_entry_text_callback (GtkComboBox *combo,
1877    ///                             const char *path,
1878    ///                             gpointer     user_data)
1879    /// {
1880    ///   GtkTreeIter iter;
1881    ///   GtkTreeModel model;
1882    ///   double       value;
1883    ///
1884    ///   model = gtk_combo_box_get_model (combo);
1885    ///
1886    ///   gtk_tree_model_get_iter_from_string (model, &iter, path);
1887    ///   gtk_tree_model_get (model, &iter,
1888    ///                       THE_DOUBLE_VALUE_COLUMN, &value,
1889    ///                       -1);
1890    ///
1891    ///   return g_strdup_printf ("%g", value);
1892    /// }
1893    /// ```
1894    /// ## `path`
1895    /// the [`TreePath`][crate::TreePath] string from the combo box's current model
1896    ///   to format text for
1897    ///
1898    /// # Returns
1899    ///
1900    /// a newly allocated string representing @path
1901    ///   for the current [`ComboBox`][crate::ComboBox] model.
1902    #[doc(alias = "format-entry-text")]
1903    fn connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>(
1904        &self,
1905        f: F,
1906    ) -> SignalHandlerId {
1907        unsafe extern "C" fn format_entry_text_trampoline<
1908            P: IsA<ComboBox>,
1909            F: Fn(&P, &str) -> String + 'static,
1910        >(
1911            this: *mut ffi::GtkComboBox,
1912            path: *mut std::ffi::c_char,
1913            f: glib::ffi::gpointer,
1914        ) -> *mut std::ffi::c_char {
1915            let f: &F = &*(f as *const F);
1916            f(
1917                ComboBox::from_glib_borrow(this).unsafe_cast_ref(),
1918                &glib::GString::from_glib_borrow(path),
1919            )
1920            .to_glib_full()
1921        }
1922        unsafe {
1923            let f: Box_<F> = Box_::new(f);
1924            connect_raw(
1925                self.as_ptr() as *mut _,
1926                c"format-entry-text".as_ptr() as *const _,
1927                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1928                    format_entry_text_trampoline::<Self, F> as *const (),
1929                )),
1930                Box_::into_raw(f),
1931            )
1932        }
1933    }
1934
1935    /// Emitted to move the active selection.
1936    ///
1937    /// This is an [keybinding signal](class.SignalAction.html).
1938    /// ## `scroll_type`
1939    /// a [`ScrollType`][crate::ScrollType]
1940    #[doc(alias = "move-active")]
1941    fn connect_move_active<F: Fn(&Self, ScrollType) + 'static>(&self, f: F) -> SignalHandlerId {
1942        unsafe extern "C" fn move_active_trampoline<
1943            P: IsA<ComboBox>,
1944            F: Fn(&P, ScrollType) + 'static,
1945        >(
1946            this: *mut ffi::GtkComboBox,
1947            scroll_type: ffi::GtkScrollType,
1948            f: glib::ffi::gpointer,
1949        ) {
1950            let f: &F = &*(f as *const F);
1951            f(
1952                ComboBox::from_glib_borrow(this).unsafe_cast_ref(),
1953                from_glib(scroll_type),
1954            )
1955        }
1956        unsafe {
1957            let f: Box_<F> = Box_::new(f);
1958            connect_raw(
1959                self.as_ptr() as *mut _,
1960                c"move-active".as_ptr() as *const _,
1961                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1962                    move_active_trampoline::<Self, F> as *const (),
1963                )),
1964                Box_::into_raw(f),
1965            )
1966        }
1967    }
1968
1969    fn emit_move_active(&self, scroll_type: ScrollType) {
1970        self.emit_by_name::<()>("move-active", &[&scroll_type]);
1971    }
1972
1973    /// Emitted to popdown the combo box list.
1974    ///
1975    /// This is an [keybinding signal](class.SignalAction.html).
1976    ///
1977    /// The default bindings for this signal are Alt+Up and Escape.
1978    ///
1979    /// # Returns
1980    ///
1981    /// whether the combo box was popped down
1982    #[doc(alias = "popdown")]
1983    fn connect_popdown<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
1984        unsafe extern "C" fn popdown_trampoline<P: IsA<ComboBox>, F: Fn(&P) -> bool + 'static>(
1985            this: *mut ffi::GtkComboBox,
1986            f: glib::ffi::gpointer,
1987        ) -> glib::ffi::gboolean {
1988            let f: &F = &*(f as *const F);
1989            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
1990        }
1991        unsafe {
1992            let f: Box_<F> = Box_::new(f);
1993            connect_raw(
1994                self.as_ptr() as *mut _,
1995                c"popdown".as_ptr() as *const _,
1996                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1997                    popdown_trampoline::<Self, F> as *const (),
1998                )),
1999                Box_::into_raw(f),
2000            )
2001        }
2002    }
2003
2004    fn emit_popdown(&self) -> bool {
2005        self.emit_by_name("popdown", &[])
2006    }
2007
2008    /// Emitted to popup the combo box list.
2009    ///
2010    /// This is an [keybinding signal](class.SignalAction.html).
2011    ///
2012    /// The default binding for this signal is Alt+Down.
2013    #[doc(alias = "popup")]
2014    fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2015        unsafe extern "C" fn popup_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
2016            this: *mut ffi::GtkComboBox,
2017            f: glib::ffi::gpointer,
2018        ) {
2019            let f: &F = &*(f as *const F);
2020            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2021        }
2022        unsafe {
2023            let f: Box_<F> = Box_::new(f);
2024            connect_raw(
2025                self.as_ptr() as *mut _,
2026                c"popup".as_ptr() as *const _,
2027                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2028                    popup_trampoline::<Self, F> as *const (),
2029                )),
2030                Box_::into_raw(f),
2031            )
2032        }
2033    }
2034
2035    fn emit_popup(&self) {
2036        self.emit_by_name::<()>("popup", &[]);
2037    }
2038
2039    #[doc(alias = "active")]
2040    fn connect_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2041        unsafe extern "C" fn notify_active_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
2042            this: *mut ffi::GtkComboBox,
2043            _param_spec: glib::ffi::gpointer,
2044            f: glib::ffi::gpointer,
2045        ) {
2046            let f: &F = &*(f as *const F);
2047            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2048        }
2049        unsafe {
2050            let f: Box_<F> = Box_::new(f);
2051            connect_raw(
2052                self.as_ptr() as *mut _,
2053                c"notify::active".as_ptr() as *const _,
2054                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2055                    notify_active_trampoline::<Self, F> as *const (),
2056                )),
2057                Box_::into_raw(f),
2058            )
2059        }
2060    }
2061
2062    #[doc(alias = "active-id")]
2063    fn connect_active_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2064        unsafe extern "C" fn notify_active_id_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
2065            this: *mut ffi::GtkComboBox,
2066            _param_spec: glib::ffi::gpointer,
2067            f: glib::ffi::gpointer,
2068        ) {
2069            let f: &F = &*(f as *const F);
2070            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2071        }
2072        unsafe {
2073            let f: Box_<F> = Box_::new(f);
2074            connect_raw(
2075                self.as_ptr() as *mut _,
2076                c"notify::active-id".as_ptr() as *const _,
2077                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2078                    notify_active_id_trampoline::<Self, F> as *const (),
2079                )),
2080                Box_::into_raw(f),
2081            )
2082        }
2083    }
2084
2085    #[doc(alias = "button-sensitivity")]
2086    fn connect_button_sensitivity_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2087        unsafe extern "C" fn notify_button_sensitivity_trampoline<
2088            P: IsA<ComboBox>,
2089            F: Fn(&P) + 'static,
2090        >(
2091            this: *mut ffi::GtkComboBox,
2092            _param_spec: glib::ffi::gpointer,
2093            f: glib::ffi::gpointer,
2094        ) {
2095            let f: &F = &*(f as *const F);
2096            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2097        }
2098        unsafe {
2099            let f: Box_<F> = Box_::new(f);
2100            connect_raw(
2101                self.as_ptr() as *mut _,
2102                c"notify::button-sensitivity".as_ptr() as *const _,
2103                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2104                    notify_button_sensitivity_trampoline::<Self, F> as *const (),
2105                )),
2106                Box_::into_raw(f),
2107            )
2108        }
2109    }
2110
2111    #[doc(alias = "child")]
2112    fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2113        unsafe extern "C" fn notify_child_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
2114            this: *mut ffi::GtkComboBox,
2115            _param_spec: glib::ffi::gpointer,
2116            f: glib::ffi::gpointer,
2117        ) {
2118            let f: &F = &*(f as *const F);
2119            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2120        }
2121        unsafe {
2122            let f: Box_<F> = Box_::new(f);
2123            connect_raw(
2124                self.as_ptr() as *mut _,
2125                c"notify::child".as_ptr() as *const _,
2126                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2127                    notify_child_trampoline::<Self, F> as *const (),
2128                )),
2129                Box_::into_raw(f),
2130            )
2131        }
2132    }
2133
2134    #[doc(alias = "entry-text-column")]
2135    fn connect_entry_text_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2136        unsafe extern "C" fn notify_entry_text_column_trampoline<
2137            P: IsA<ComboBox>,
2138            F: Fn(&P) + 'static,
2139        >(
2140            this: *mut ffi::GtkComboBox,
2141            _param_spec: glib::ffi::gpointer,
2142            f: glib::ffi::gpointer,
2143        ) {
2144            let f: &F = &*(f as *const F);
2145            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2146        }
2147        unsafe {
2148            let f: Box_<F> = Box_::new(f);
2149            connect_raw(
2150                self.as_ptr() as *mut _,
2151                c"notify::entry-text-column".as_ptr() as *const _,
2152                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2153                    notify_entry_text_column_trampoline::<Self, F> as *const (),
2154                )),
2155                Box_::into_raw(f),
2156            )
2157        }
2158    }
2159
2160    #[doc(alias = "has-frame")]
2161    fn connect_has_frame_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2162        unsafe extern "C" fn notify_has_frame_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
2163            this: *mut ffi::GtkComboBox,
2164            _param_spec: glib::ffi::gpointer,
2165            f: glib::ffi::gpointer,
2166        ) {
2167            let f: &F = &*(f as *const F);
2168            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2169        }
2170        unsafe {
2171            let f: Box_<F> = Box_::new(f);
2172            connect_raw(
2173                self.as_ptr() as *mut _,
2174                c"notify::has-frame".as_ptr() as *const _,
2175                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2176                    notify_has_frame_trampoline::<Self, F> as *const (),
2177                )),
2178                Box_::into_raw(f),
2179            )
2180        }
2181    }
2182
2183    #[doc(alias = "id-column")]
2184    fn connect_id_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2185        unsafe extern "C" fn notify_id_column_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
2186            this: *mut ffi::GtkComboBox,
2187            _param_spec: glib::ffi::gpointer,
2188            f: glib::ffi::gpointer,
2189        ) {
2190            let f: &F = &*(f as *const F);
2191            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2192        }
2193        unsafe {
2194            let f: Box_<F> = Box_::new(f);
2195            connect_raw(
2196                self.as_ptr() as *mut _,
2197                c"notify::id-column".as_ptr() as *const _,
2198                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2199                    notify_id_column_trampoline::<Self, F> as *const (),
2200                )),
2201                Box_::into_raw(f),
2202            )
2203        }
2204    }
2205
2206    #[doc(alias = "model")]
2207    fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2208        unsafe extern "C" fn notify_model_trampoline<P: IsA<ComboBox>, F: Fn(&P) + 'static>(
2209            this: *mut ffi::GtkComboBox,
2210            _param_spec: glib::ffi::gpointer,
2211            f: glib::ffi::gpointer,
2212        ) {
2213            let f: &F = &*(f as *const F);
2214            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2215        }
2216        unsafe {
2217            let f: Box_<F> = Box_::new(f);
2218            connect_raw(
2219                self.as_ptr() as *mut _,
2220                c"notify::model".as_ptr() as *const _,
2221                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2222                    notify_model_trampoline::<Self, F> as *const (),
2223                )),
2224                Box_::into_raw(f),
2225            )
2226        }
2227    }
2228
2229    #[doc(alias = "popup-fixed-width")]
2230    fn connect_popup_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2231        unsafe extern "C" fn notify_popup_fixed_width_trampoline<
2232            P: IsA<ComboBox>,
2233            F: Fn(&P) + 'static,
2234        >(
2235            this: *mut ffi::GtkComboBox,
2236            _param_spec: glib::ffi::gpointer,
2237            f: glib::ffi::gpointer,
2238        ) {
2239            let f: &F = &*(f as *const F);
2240            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2241        }
2242        unsafe {
2243            let f: Box_<F> = Box_::new(f);
2244            connect_raw(
2245                self.as_ptr() as *mut _,
2246                c"notify::popup-fixed-width".as_ptr() as *const _,
2247                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2248                    notify_popup_fixed_width_trampoline::<Self, F> as *const (),
2249                )),
2250                Box_::into_raw(f),
2251            )
2252        }
2253    }
2254
2255    #[doc(alias = "popup-shown")]
2256    fn connect_popup_shown_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2257        unsafe extern "C" fn notify_popup_shown_trampoline<
2258            P: IsA<ComboBox>,
2259            F: Fn(&P) + 'static,
2260        >(
2261            this: *mut ffi::GtkComboBox,
2262            _param_spec: glib::ffi::gpointer,
2263            f: glib::ffi::gpointer,
2264        ) {
2265            let f: &F = &*(f as *const F);
2266            f(ComboBox::from_glib_borrow(this).unsafe_cast_ref())
2267        }
2268        unsafe {
2269            let f: Box_<F> = Box_::new(f);
2270            connect_raw(
2271                self.as_ptr() as *mut _,
2272                c"notify::popup-shown".as_ptr() as *const _,
2273                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2274                    notify_popup_shown_trampoline::<Self, F> as *const (),
2275                )),
2276                Box_::into_raw(f),
2277            )
2278        }
2279    }
2280}
2281
2282impl<O: IsA<ComboBox>> ComboBoxExt for O {}