Skip to main content

ComboBoxExt

Trait ComboBoxExt 

Source
pub trait ComboBoxExt: IsA<ComboBox> + 'static {
Show 44 methods // Provided methods fn active_id(&self) -> Option<GString> { ... } fn active_iter(&self) -> Option<TreeIter> { ... } fn button_sensitivity(&self) -> SensitivityType { ... } fn child(&self) -> Option<Widget> { ... } fn entry_text_column(&self) -> i32 { ... } fn has_entry(&self) -> bool { ... } fn id_column(&self) -> i32 { ... } fn model(&self) -> Option<TreeModel> { ... } fn is_popup_fixed_width(&self) -> bool { ... } fn popdown(&self) { ... } fn popup(&self) { ... } fn popup_for_device(&self, device: &Device) { ... } fn set_active_id(&self, active_id: Option<&str>) -> bool { ... } fn set_active_iter(&self, iter: Option<&TreeIter>) { ... } fn set_button_sensitivity(&self, sensitivity: SensitivityType) { ... } fn set_child(&self, child: Option<&impl IsA<Widget>>) { ... } fn set_entry_text_column(&self, text_column: i32) { ... } fn set_id_column(&self, id_column: i32) { ... } fn set_model(&self, model: Option<&impl IsA<TreeModel>>) { ... } fn set_popup_fixed_width(&self, fixed: bool) { ... } fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>( &self, func: P, ) { ... } fn has_frame(&self) -> bool { ... } fn set_has_frame(&self, has_frame: bool) { ... } fn is_popup_shown(&self) -> bool { ... } fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_activate(&self) { ... } fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_move_active<F: Fn(&Self, ScrollType) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_move_active(&self, scroll_type: ScrollType) { ... } fn connect_popdown<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn emit_popdown(&self) -> bool { ... } fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... } fn emit_popup(&self) { ... } fn connect_active_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_active_id_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_button_sensitivity_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_child_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_entry_text_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_has_frame_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_id_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_model_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_popup_fixed_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_popup_shown_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
๐Ÿ‘ŽDeprecated:

Since 4.10

Expand description

Trait containing all ComboBox methods.

ยงImplementors

ComboBoxText, ComboBox

Provided Methodsยง

Source

fn active_id(&self) -> Option<GString>

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns the ID of the active row of @self.

This value is taken from the active row and the column specified by the id-column property of @self (see set_id_column()).

The returned value is an interned string which means that you can compare the pointer by value to other interned strings and that you must not free it.

If the id-column property of @self is not set, or if no row is active, or if the active row has a None ID value, then None is returned.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

the ID of the active row

Source

fn active_iter(&self) -> Option<TreeIter>

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets @iter to point to the currently active item.

If no item is active, @iter is left unchanged.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

true if @iter was set, false otherwise

ยงiter

A TreeIter

Source

fn button_sensitivity(&self) -> SensitivityType

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

SensitivityType::On if the dropdown button is sensitive when the model is empty, SensitivityType::Off if the button is always insensitive or SensitivityType::Auto if it is only sensitive as long as the model has one item to be selected.

Source

fn child(&self) -> Option<Widget>

๐Ÿ‘ŽDeprecated:

Since 4.10

Gets the child widget of @self.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

the child widget of @self

Source

fn entry_text_column(&self) -> i32

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns the column which @self is using to get the strings from to display in the internal entry.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

A column in the data source model of @self.

Source

fn has_entry(&self) -> bool

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns whether the combo box has an entry.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

whether there is an entry in @self.

Source

fn id_column(&self) -> i32

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns the column which @self is using to get string IDs for values from.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

A column in the data source model of @self.

Source

fn model(&self) -> Option<TreeModel>

๐Ÿ‘ŽDeprecated:

Since 4.10

Returns the TreeModel of @self.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

A TreeModel which was passed during construction.

Source

fn is_popup_fixed_width(&self) -> bool

๐Ÿ‘ŽDeprecated:

Since 4.10

Gets whether the popup uses a fixed width.

ยงDeprecated since 4.10

Use DropDown

ยงReturns

true if the popup uses a fixed width

Source

fn popdown(&self)

๐Ÿ‘ŽDeprecated:

Since 4.10

Hides the menu or dropdown list of @self.

This function is mostly intended for use by accessibility technologies; applications should have little use for it.

ยงDeprecated since 4.10

Use DropDown

Source

fn popup(&self)

๐Ÿ‘ŽDeprecated:

Since 4.10

Pops up the menu or dropdown list of @self.

This function is mostly intended for use by accessibility technologies; applications should have little use for it.

Before calling this, @self must be mapped, or nothing will happen.

ยงDeprecated since 4.10

Use DropDown

Source

fn popup_for_device(&self, device: &Device)

๐Ÿ‘ŽDeprecated:

Since 4.10

Pops up the menu of @self.

Note that currently this does not do anything with the device, as it was previously only used for list-mode combo boxes, and those were removed in GTK 4. However, it is retained in case similar functionality is added back later.

ยงDeprecated since 4.10

Use DropDown

ยงdevice

a gdk::Device

Source

fn set_active_id(&self, active_id: Option<&str>) -> bool

๐Ÿ‘ŽDeprecated:

Since 4.10

Changes the active row of @self to the one that has an ID equal to @active_id.

If @active_id is None, the active row is unset. Rows having a None ID string cannot be made active by this function.

If the id-column property of @self is unset or if no row has the given ID then the function does nothing and returns false.

ยงDeprecated since 4.10

Use DropDown

ยงactive_id

the ID of the row to select

ยงReturns

true if a row with a matching ID was found. If a None @active_id was given to unset the active row, the function always returns true.

Source

fn set_active_iter(&self, iter: Option<&TreeIter>)

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets the current active item to be the one referenced by @iter.

If @iter is None, the active item is unset.

ยงDeprecated since 4.10

Use DropDown

ยงiter

The TreeIter

Source

fn set_button_sensitivity(&self, sensitivity: SensitivityType)

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets whether the dropdown button of the combo box should update its sensitivity depending on the model contents.

ยงDeprecated since 4.10

Use DropDown

ยงsensitivity

specify the sensitivity of the dropdown button

Source

fn set_child(&self, child: Option<&impl IsA<Widget>>)

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets the child widget of @self.

ยงDeprecated since 4.10

Use DropDown

ยงchild

the child widget

Source

fn set_entry_text_column(&self, text_column: i32)

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets the model column which @self should use to get strings from to be @text_column.

For this column no separate CellRenderer is needed.

The column @text_column in the model of @self must be of type G_TYPE_STRING.

This is only relevant if @self has been created with has-entry as true.

ยงDeprecated since 4.10

Use DropDown

ยงtext_column

A column in @model to get the strings from for the internal entry

Source

fn set_id_column(&self, id_column: i32)

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets the model column which @self should use to get string IDs for values from.

The column @id_column in the model of @self must be of type G_TYPE_STRING.

ยงDeprecated since 4.10

Use DropDown

ยงid_column

A column in @model to get string IDs for values from

Source

fn set_model(&self, model: Option<&impl IsA<TreeModel>>)

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets the model used by @self to be @model.

Will unset a previously set model (if applicable). If model is None, then it will unset the model.

Note that this function does not clear the cell renderers, you have to call CellLayoutExt::clear() yourself if you need to set up different cell renderers for the new model.

ยงDeprecated since 4.10

Use DropDown

ยงmodel

A TreeModel

Source

fn set_popup_fixed_width(&self, fixed: bool)

๐Ÿ‘ŽDeprecated:

Since 4.10

s width should be a fixed width.

If @fixed is true, the popupโ€™s width is set to match the allocated width of the combo box.

ยงDeprecated since 4.10

Use DropDown

ยงfixed

whether to use a fixed popup width

Source

fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>( &self, func: P, )

๐Ÿ‘ŽDeprecated:

Since 4.10

Sets the row separator function, which is used to determine whether a row should be drawn as a separator.

If the row separator function is None, no separators are drawn. This is the default value.

ยงDeprecated since 4.10

Use DropDown

ยงfunc

a GtkTreeViewRowSeparatorFunc

Source

fn has_frame(&self) -> bool

๐Ÿ‘ŽDeprecated:

Since 4.10

The has-frame property controls whether a frame is drawn around the entry.

Source

fn set_has_frame(&self, has_frame: bool)

๐Ÿ‘ŽDeprecated:

Since 4.10

The has-frame property controls whether a frame is drawn around the entry.

Source

fn is_popup_shown(&self) -> bool

๐Ÿ‘ŽDeprecated:

Since 4.10

Whether the combo boxes dropdown is popped up.

Note that this property is mainly useful, because it allows you to connect to notify::popup-shown.

Source

fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Available on crate feature v4_6 only.

Emitted to when the combo box is activated.

The ::activate signal on ComboBox is an action signal and emitting it causes the combo box to pop up its dropdown.

Source

fn emit_activate(&self)

๐Ÿ‘ŽDeprecated:

Since 4.10

Available on crate feature v4_6 only.
Source

fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Emitted when the active item is changed.

The can be due to the user selecting a different item from the list, or due to a call to set_active_iter(). It will also be emitted while typing into the entry of a combo box with an entry.

Source

fn connect_format_entry_text<F: Fn(&Self, &str) -> String + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

value, -1);

return g_strdup_printf (โ€œgโ€, value); }


## `path`
the [`TreePath`][crate::TreePath] string from the combo box's current model
  to format text for

# Returns

a newly allocated string representing @path
  for the current [`ComboBox`][crate::ComboBox] model.
Source

fn connect_move_active<F: Fn(&Self, ScrollType) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Emitted to move the active selection.

This is an keybinding signal.

ยงscroll_type

a ScrollType

Source

fn emit_move_active(&self, scroll_type: ScrollType)

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_popdown<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Emitted to popdown the combo box list.

This is an keybinding signal.

The default bindings for this signal are Alt+Up and Escape.

ยงReturns

whether the combo box was popped down

Source

fn emit_popdown(&self) -> bool

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_popup<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Emitted to popup the combo box list.

This is an keybinding signal.

The default binding for this signal is Alt+Down.

Source

fn emit_popup(&self)

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_active_id_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_button_sensitivity_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_child_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_entry_text_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_has_frame_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_id_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_popup_fixed_width_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Source

fn connect_popup_shown_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

๐Ÿ‘ŽDeprecated:

Since 4.10

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementorsยง