Skip to main content

gtk/auto/
combo_box_text.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{
6    Align, Bin, Buildable, CellArea, CellEditable, CellLayout, ComboBox, Container, ResizeMode,
7    SensitivityType, TreeModel, Widget, ffi,
8};
9use glib::{prelude::*, translate::*};
10
11glib::wrapper! {
12    ///
13    /// combobox
14    /// ╰── box.linked
15    ///  ├── entry.combo
16    ///  ├── button.combo
17    ///  ╰── window.popup
18    /// ]|
19    ///
20    /// GtkComboBoxText has a single CSS node with name combobox. It adds
21    /// the style class .combo to the main CSS nodes of its entry and button
22    /// children, and the .linked class to the node of its internal box.
23    ///
24    /// # Implements
25    ///
26    /// [`ComboBoxTextExt`][trait@crate::prelude::ComboBoxTextExt], [`ComboBoxExt`][trait@crate::prelude::ComboBoxExt], [`BinExt`][trait@crate::prelude::BinExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`CellEditableExt`][trait@crate::prelude::CellEditableExt], [`CellLayoutExt`][trait@crate::prelude::CellLayoutExt], [`ComboBoxExtManual`][trait@crate::prelude::ComboBoxExtManual], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
27    #[doc(alias = "GtkComboBoxText")]
28    pub struct ComboBoxText(Object<ffi::GtkComboBoxText, ffi::GtkComboBoxTextClass>) @extends ComboBox, Bin, Container, Widget, @implements Buildable, CellEditable, CellLayout;
29
30    match fn {
31        type_ => || ffi::gtk_combo_box_text_get_type(),
32    }
33}
34
35impl ComboBoxText {
36    pub const NONE: Option<&'static ComboBoxText> = None;
37
38    /// Creates a new [`ComboBoxText`][crate::ComboBoxText], which is a [`ComboBox`][crate::ComboBox] just displaying
39    /// strings.
40    ///
41    /// # Returns
42    ///
43    /// A new [`ComboBoxText`][crate::ComboBoxText]
44    #[doc(alias = "gtk_combo_box_text_new")]
45    pub fn new() -> ComboBoxText {
46        assert_initialized_main_thread!();
47        unsafe { Widget::from_glib_none(ffi::gtk_combo_box_text_new()).unsafe_cast() }
48    }
49
50    /// Creates a new [`ComboBoxText`][crate::ComboBoxText], which is a [`ComboBox`][crate::ComboBox] just displaying
51    /// strings. The combo box created by this function has an entry.
52    ///
53    /// # Returns
54    ///
55    /// a new [`ComboBoxText`][crate::ComboBoxText]
56    #[doc(alias = "gtk_combo_box_text_new_with_entry")]
57    #[doc(alias = "new_with_entry")]
58    pub fn with_entry() -> ComboBoxText {
59        assert_initialized_main_thread!();
60        unsafe { Widget::from_glib_none(ffi::gtk_combo_box_text_new_with_entry()).unsafe_cast() }
61    }
62
63    // rustdoc-stripper-ignore-next
64    /// Creates a new builder-pattern struct instance to construct [`ComboBoxText`] objects.
65    ///
66    /// This method returns an instance of [`ComboBoxTextBuilder`](crate::builders::ComboBoxTextBuilder) which can be used to create [`ComboBoxText`] objects.
67    pub fn builder() -> ComboBoxTextBuilder {
68        ComboBoxTextBuilder::new()
69    }
70}
71
72impl Default for ComboBoxText {
73    fn default() -> Self {
74        Self::new()
75    }
76}
77
78// rustdoc-stripper-ignore-next
79/// A [builder-pattern] type to construct [`ComboBoxText`] objects.
80///
81/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
82#[must_use = "The builder must be built to be used"]
83pub struct ComboBoxTextBuilder {
84    builder: glib::object::ObjectBuilder<'static, ComboBoxText>,
85}
86
87impl ComboBoxTextBuilder {
88    fn new() -> Self {
89        Self {
90            builder: glib::object::Object::builder(),
91        }
92    }
93
94    /// The item which is currently active. If the model is a non-flat treemodel,
95    /// and the active item is not an immediate child of the root of the tree,
96    /// this property has the value
97    /// `gtk_tree_path_get_indices (path)[0]`,
98    /// where `path` is the [`TreePath`][crate::TreePath] of the active item.
99    pub fn active(self, active: i32) -> Self {
100        Self {
101            builder: self.builder.property("active", active),
102        }
103    }
104
105    /// The value of the ID column of the active row.
106    pub fn active_id(self, active_id: impl Into<glib::GString>) -> Self {
107        Self {
108            builder: self.builder.property("active-id", active_id.into()),
109        }
110    }
111
112    /// Whether the dropdown button is sensitive when
113    /// the model is empty.
114    pub fn button_sensitivity(self, button_sensitivity: SensitivityType) -> Self {
115        Self {
116            builder: self
117                .builder
118                .property("button-sensitivity", button_sensitivity),
119        }
120    }
121
122    /// The [`CellArea`][crate::CellArea] used to layout cell renderers for this combo box.
123    ///
124    /// If no area is specified when creating the combo box with [`ComboBox::with_area()`][crate::ComboBox::with_area()]
125    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
126    pub fn cell_area(self, cell_area: &impl IsA<CellArea>) -> Self {
127        Self {
128            builder: self
129                .builder
130                .property("cell-area", cell_area.clone().upcast()),
131        }
132    }
133
134    /// If this is set to a non-negative value, it must be the index of a column
135    /// of type `G_TYPE_INT` in the model. The value in that column for each item
136    /// will determine how many columns that item will span in the popup.
137    /// Therefore, values in this column must be greater than zero, and the sum of
138    /// an item’s column position + span should not exceed [`wrap-width`][struct@crate::ComboBox#wrap-width].
139    pub fn column_span_column(self, column_span_column: i32) -> Self {
140        Self {
141            builder: self
142                .builder
143                .property("column-span-column", column_span_column),
144        }
145    }
146
147    /// The column in the combo box's model to associate with strings from the entry
148    /// if the combo was created with [`has-entry`][struct@crate::ComboBox#has-entry] = [`true`].
149    pub fn entry_text_column(self, entry_text_column: i32) -> Self {
150        Self {
151            builder: self
152                .builder
153                .property("entry-text-column", entry_text_column),
154        }
155    }
156
157    /// Whether the combo box has an entry.
158    pub fn has_entry(self, has_entry: bool) -> Self {
159        Self {
160            builder: self.builder.property("has-entry", has_entry),
161        }
162    }
163
164    /// The has-frame property controls whether a frame
165    /// is drawn around the entry.
166    pub fn has_frame(self, has_frame: bool) -> Self {
167        Self {
168            builder: self.builder.property("has-frame", has_frame),
169        }
170    }
171
172    /// The column in the combo box's model that provides string
173    /// IDs for the values in the model, if != -1.
174    pub fn id_column(self, id_column: i32) -> Self {
175        Self {
176            builder: self.builder.property("id-column", id_column),
177        }
178    }
179
180    /// The model from which the combo box takes the values shown
181    /// in the list.
182    pub fn model(self, model: &impl IsA<TreeModel>) -> Self {
183        Self {
184            builder: self.builder.property("model", model.clone().upcast()),
185        }
186    }
187
188    /// Whether the popup's width should be a fixed width matching the
189    /// allocated width of the combo box.
190    pub fn popup_fixed_width(self, popup_fixed_width: bool) -> Self {
191        Self {
192            builder: self
193                .builder
194                .property("popup-fixed-width", popup_fixed_width),
195        }
196    }
197
198    /// If this is set to a non-negative value, it must be the index of a column
199    /// of type `G_TYPE_INT` in the model. The value in that column for each item
200    /// will determine how many rows that item will span in the popup. Therefore,
201    /// values in this column must be greater than zero.
202    pub fn row_span_column(self, row_span_column: i32) -> Self {
203        Self {
204            builder: self.builder.property("row-span-column", row_span_column),
205        }
206    }
207
208    /// If wrap-width is set to a positive value, items in the popup will be laid
209    /// out along multiple columns, starting a new row on reaching the wrap width.
210    pub fn wrap_width(self, wrap_width: i32) -> Self {
211        Self {
212            builder: self.builder.property("wrap-width", wrap_width),
213        }
214    }
215
216    pub fn border_width(self, border_width: u32) -> Self {
217        Self {
218            builder: self.builder.property("border-width", border_width),
219        }
220    }
221
222    pub fn child(self, child: &impl IsA<Widget>) -> Self {
223        Self {
224            builder: self.builder.property("child", child.clone().upcast()),
225        }
226    }
227
228    pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
229        Self {
230            builder: self.builder.property("resize-mode", resize_mode),
231        }
232    }
233
234    pub fn app_paintable(self, app_paintable: bool) -> Self {
235        Self {
236            builder: self.builder.property("app-paintable", app_paintable),
237        }
238    }
239
240    pub fn can_default(self, can_default: bool) -> Self {
241        Self {
242            builder: self.builder.property("can-default", can_default),
243        }
244    }
245
246    pub fn can_focus(self, can_focus: bool) -> Self {
247        Self {
248            builder: self.builder.property("can-focus", can_focus),
249        }
250    }
251
252    pub fn events(self, events: gdk::EventMask) -> Self {
253        Self {
254            builder: self.builder.property("events", events),
255        }
256    }
257
258    /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
259    pub fn expand(self, expand: bool) -> Self {
260        Self {
261            builder: self.builder.property("expand", expand),
262        }
263    }
264
265    /// Whether the widget should grab focus when it is clicked with the mouse.
266    ///
267    /// This property is only relevant for widgets that can take focus.
268    ///
269    /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
270    /// GtkComboBox) implemented this property individually.
271    pub fn focus_on_click(self, focus_on_click: bool) -> Self {
272        Self {
273            builder: self.builder.property("focus-on-click", focus_on_click),
274        }
275    }
276
277    /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
278    pub fn halign(self, halign: Align) -> Self {
279        Self {
280            builder: self.builder.property("halign", halign),
281        }
282    }
283
284    pub fn has_default(self, has_default: bool) -> Self {
285        Self {
286            builder: self.builder.property("has-default", has_default),
287        }
288    }
289
290    pub fn has_focus(self, has_focus: bool) -> Self {
291        Self {
292            builder: self.builder.property("has-focus", has_focus),
293        }
294    }
295
296    /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
297    /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
298    /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
299    /// whether it will provide a tooltip or not.
300    ///
301    /// Note that setting this property to [`true`] for the first time will change
302    /// the event masks of the GdkWindows of this widget to include leave-notify
303    /// and motion-notify events. This cannot and will not be undone when the
304    /// property is set to [`false`] again.
305    pub fn has_tooltip(self, has_tooltip: bool) -> Self {
306        Self {
307            builder: self.builder.property("has-tooltip", has_tooltip),
308        }
309    }
310
311    pub fn height_request(self, height_request: i32) -> Self {
312        Self {
313            builder: self.builder.property("height-request", height_request),
314        }
315    }
316
317    /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
318    pub fn hexpand(self, hexpand: bool) -> Self {
319        Self {
320            builder: self.builder.property("hexpand", hexpand),
321        }
322    }
323
324    /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
325    pub fn hexpand_set(self, hexpand_set: bool) -> Self {
326        Self {
327            builder: self.builder.property("hexpand-set", hexpand_set),
328        }
329    }
330
331    pub fn is_focus(self, is_focus: bool) -> Self {
332        Self {
333            builder: self.builder.property("is-focus", is_focus),
334        }
335    }
336
337    /// Sets all four sides' margin at once. If read, returns max
338    /// margin on any side.
339    pub fn margin(self, margin: i32) -> Self {
340        Self {
341            builder: self.builder.property("margin", margin),
342        }
343    }
344
345    /// Margin on bottom side of widget.
346    ///
347    /// This property adds margin outside of the widget's normal size
348    /// request, the margin will be added in addition to the size from
349    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
350    pub fn margin_bottom(self, margin_bottom: i32) -> Self {
351        Self {
352            builder: self.builder.property("margin-bottom", margin_bottom),
353        }
354    }
355
356    /// Margin on end of widget, horizontally. This property supports
357    /// left-to-right and right-to-left text directions.
358    ///
359    /// This property adds margin outside of the widget's normal size
360    /// request, the margin will be added in addition to the size from
361    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
362    pub fn margin_end(self, margin_end: i32) -> Self {
363        Self {
364            builder: self.builder.property("margin-end", margin_end),
365        }
366    }
367
368    /// Margin on start of widget, horizontally. This property supports
369    /// left-to-right and right-to-left text directions.
370    ///
371    /// This property adds margin outside of the widget's normal size
372    /// request, the margin will be added in addition to the size from
373    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
374    pub fn margin_start(self, margin_start: i32) -> Self {
375        Self {
376            builder: self.builder.property("margin-start", margin_start),
377        }
378    }
379
380    /// Margin on top side of widget.
381    ///
382    /// This property adds margin outside of the widget's normal size
383    /// request, the margin will be added in addition to the size from
384    /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
385    pub fn margin_top(self, margin_top: i32) -> Self {
386        Self {
387            builder: self.builder.property("margin-top", margin_top),
388        }
389    }
390
391    pub fn name(self, name: impl Into<glib::GString>) -> Self {
392        Self {
393            builder: self.builder.property("name", name.into()),
394        }
395    }
396
397    pub fn no_show_all(self, no_show_all: bool) -> Self {
398        Self {
399            builder: self.builder.property("no-show-all", no_show_all),
400        }
401    }
402
403    /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
404    /// more details about window opacity.
405    ///
406    /// Before 3.8 this was only available in GtkWindow
407    pub fn opacity(self, opacity: f64) -> Self {
408        Self {
409            builder: self.builder.property("opacity", opacity),
410        }
411    }
412
413    pub fn parent(self, parent: &impl IsA<Container>) -> Self {
414        Self {
415            builder: self.builder.property("parent", parent.clone().upcast()),
416        }
417    }
418
419    pub fn receives_default(self, receives_default: bool) -> Self {
420        Self {
421            builder: self.builder.property("receives-default", receives_default),
422        }
423    }
424
425    pub fn sensitive(self, sensitive: bool) -> Self {
426        Self {
427            builder: self.builder.property("sensitive", sensitive),
428        }
429    }
430
431    /// Sets the text of tooltip to be the given string, which is marked up
432    /// with the [Pango text markup language][PangoMarkupFormat].
433    /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
434    ///
435    /// This is a convenience property which will take care of getting the
436    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
437    /// will automatically be set to [`true`] and there will be taken care of
438    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
439    ///
440    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
441    /// are set, the last one wins.
442    pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
443        Self {
444            builder: self
445                .builder
446                .property("tooltip-markup", tooltip_markup.into()),
447        }
448    }
449
450    /// Sets the text of tooltip to be the given string.
451    ///
452    /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
453    ///
454    /// This is a convenience property which will take care of getting the
455    /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
456    /// will automatically be set to [`true`] and there will be taken care of
457    /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
458    ///
459    /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
460    /// are set, the last one wins.
461    pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
462        Self {
463            builder: self.builder.property("tooltip-text", tooltip_text.into()),
464        }
465    }
466
467    /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
468    pub fn valign(self, valign: Align) -> Self {
469        Self {
470            builder: self.builder.property("valign", valign),
471        }
472    }
473
474    /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
475    pub fn vexpand(self, vexpand: bool) -> Self {
476        Self {
477            builder: self.builder.property("vexpand", vexpand),
478        }
479    }
480
481    /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
482    pub fn vexpand_set(self, vexpand_set: bool) -> Self {
483        Self {
484            builder: self.builder.property("vexpand-set", vexpand_set),
485        }
486    }
487
488    pub fn visible(self, visible: bool) -> Self {
489        Self {
490            builder: self.builder.property("visible", visible),
491        }
492    }
493
494    pub fn width_request(self, width_request: i32) -> Self {
495        Self {
496            builder: self.builder.property("width-request", width_request),
497        }
498    }
499
500    /// Indicates whether editing on the cell has been canceled.
501    pub fn editing_canceled(self, editing_canceled: bool) -> Self {
502        Self {
503            builder: self.builder.property("editing-canceled", editing_canceled),
504        }
505    }
506
507    // rustdoc-stripper-ignore-next
508    /// Build the [`ComboBoxText`].
509    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
510    pub fn build(self) -> ComboBoxText {
511        assert_initialized_main_thread!();
512        self.builder.build()
513    }
514}
515
516/// Trait containing all [`struct@ComboBoxText`] methods.
517///
518/// # Implementors
519///
520/// [`ComboBoxText`][struct@crate::ComboBoxText]
521pub trait ComboBoxTextExt: IsA<ComboBoxText> + 'static {
522    /// Appends `text` to the list of strings stored in `self`.
523    /// If `id` is non-[`None`] then it is used as the ID of the row.
524    ///
525    /// This is the same as calling [`insert()`][Self::insert()] with a
526    /// position of -1.
527    /// ## `id`
528    /// a string ID for this value, or [`None`]
529    /// ## `text`
530    /// A string
531    #[doc(alias = "gtk_combo_box_text_append")]
532    fn append(&self, id: Option<&str>, text: &str) {
533        unsafe {
534            ffi::gtk_combo_box_text_append(
535                self.as_ref().to_glib_none().0,
536                id.to_glib_none().0,
537                text.to_glib_none().0,
538            );
539        }
540    }
541
542    /// Appends `text` to the list of strings stored in `self`.
543    ///
544    /// This is the same as calling [`insert_text()`][Self::insert_text()] with a
545    /// position of -1.
546    /// ## `text`
547    /// A string
548    #[doc(alias = "gtk_combo_box_text_append_text")]
549    fn append_text(&self, text: &str) {
550        unsafe {
551            ffi::gtk_combo_box_text_append_text(
552                self.as_ref().to_glib_none().0,
553                text.to_glib_none().0,
554            );
555        }
556    }
557
558    /// Returns the currently active string in `self`, or [`None`]
559    /// if none is selected. If `self` contains an entry, this
560    /// function will return its contents (which will not necessarily
561    /// be an item from the list).
562    ///
563    /// # Returns
564    ///
565    /// a newly allocated string containing the
566    ///  currently active text. Must be freed with `g_free()`.
567    #[doc(alias = "gtk_combo_box_text_get_active_text")]
568    #[doc(alias = "get_active_text")]
569    fn active_text(&self) -> Option<glib::GString> {
570        unsafe {
571            from_glib_full(ffi::gtk_combo_box_text_get_active_text(
572                self.as_ref().to_glib_none().0,
573            ))
574        }
575    }
576
577    /// Inserts `text` at `position` in the list of strings stored in `self`.
578    /// If `id` is non-[`None`] then it is used as the ID of the row. See
579    /// [`id-column`][struct@crate::ComboBox#id-column].
580    ///
581    /// If `position` is negative then `text` is appended.
582    /// ## `position`
583    /// An index to insert `text`
584    /// ## `id`
585    /// a string ID for this value, or [`None`]
586    /// ## `text`
587    /// A string to display
588    #[doc(alias = "gtk_combo_box_text_insert")]
589    fn insert(&self, position: i32, id: Option<&str>, text: &str) {
590        unsafe {
591            ffi::gtk_combo_box_text_insert(
592                self.as_ref().to_glib_none().0,
593                position,
594                id.to_glib_none().0,
595                text.to_glib_none().0,
596            );
597        }
598    }
599
600    /// Inserts `text` at `position` in the list of strings stored in `self`.
601    ///
602    /// If `position` is negative then `text` is appended.
603    ///
604    /// This is the same as calling [`insert()`][Self::insert()] with a [`None`]
605    /// ID string.
606    /// ## `position`
607    /// An index to insert `text`
608    /// ## `text`
609    /// A string
610    #[doc(alias = "gtk_combo_box_text_insert_text")]
611    fn insert_text(&self, position: i32, text: &str) {
612        unsafe {
613            ffi::gtk_combo_box_text_insert_text(
614                self.as_ref().to_glib_none().0,
615                position,
616                text.to_glib_none().0,
617            );
618        }
619    }
620
621    /// Prepends `text` to the list of strings stored in `self`.
622    /// If `id` is non-[`None`] then it is used as the ID of the row.
623    ///
624    /// This is the same as calling [`insert()`][Self::insert()] with a
625    /// position of 0.
626    /// ## `id`
627    /// a string ID for this value, or [`None`]
628    /// ## `text`
629    /// a string
630    #[doc(alias = "gtk_combo_box_text_prepend")]
631    fn prepend(&self, id: Option<&str>, text: &str) {
632        unsafe {
633            ffi::gtk_combo_box_text_prepend(
634                self.as_ref().to_glib_none().0,
635                id.to_glib_none().0,
636                text.to_glib_none().0,
637            );
638        }
639    }
640
641    /// Prepends `text` to the list of strings stored in `self`.
642    ///
643    /// This is the same as calling [`insert_text()`][Self::insert_text()] with a
644    /// position of 0.
645    /// ## `text`
646    /// A string
647    #[doc(alias = "gtk_combo_box_text_prepend_text")]
648    fn prepend_text(&self, text: &str) {
649        unsafe {
650            ffi::gtk_combo_box_text_prepend_text(
651                self.as_ref().to_glib_none().0,
652                text.to_glib_none().0,
653            );
654        }
655    }
656
657    /// Removes the string at `position` from `self`.
658    /// ## `position`
659    /// Index of the item to remove
660    #[doc(alias = "gtk_combo_box_text_remove")]
661    fn remove(&self, position: i32) {
662        unsafe {
663            ffi::gtk_combo_box_text_remove(self.as_ref().to_glib_none().0, position);
664        }
665    }
666
667    /// Removes all the text entries from the combo box.
668    #[doc(alias = "gtk_combo_box_text_remove_all")]
669    fn remove_all(&self) {
670        unsafe {
671            ffi::gtk_combo_box_text_remove_all(self.as_ref().to_glib_none().0);
672        }
673    }
674}
675
676impl<O: IsA<ComboBoxText>> ComboBoxTextExt for O {}