[]Struct gtk::ComboBox

pub struct ComboBox(_, _);

A ComboBox is a widget that allows the user to choose from a list of valid choices. The ComboBox displays the selected choice. When activated, the ComboBox displays a popup which allows the user to make a new choice. The style in which the selected value is displayed, and the style of the popup is determined by the current theme. It may be similar to a Windows-style combo box.

The ComboBox uses the model-view pattern; the list of valid choices is specified in the form of a tree model, and the display of the choices can be adapted to the data in the model by using cell renderers, as you would in a tree view. This is possible since ComboBox implements the CellLayout interface. The tree model holding the valid choices is not restricted to a flat list, it can be a real tree, and the popup will reflect the tree structure.

To allow the user to enter values not in the model, the “has-entry” property allows the ComboBox to contain a Entry. This entry can be accessed by calling BinExt::get_child on the combo box.

For a simple list of textual choices, the model-view API of ComboBox can be a bit overwhelming. In this case, ComboBoxText offers a simple alternative. Both ComboBox and ComboBoxText can contain an entry.

CSS nodes

combobox
├── box.linked
│   ╰── button.combo
│       ╰── box
│           ├── cellview
│           ╰── arrow
╰── window.popup

A normal combobox contains a box with the .linked class, a button with the .combo class and inside those buttons, there are a cellview and an arrow.

combobox
├── box.linked
│   ├── entry.combo
│   ╰── button.combo
│       ╰── box
│           ╰── arrow
╰── window.popup

A ComboBox with an entry has a single CSS node with name combobox. It contains a box with the .linked class. That box contains an entry and a button, both with the .combo class added. The button also contains another node with name arrow.

Implements

ComboBoxExt, BinExt, ContainerExt, WidgetExt, glib::object::ObjectExt, BuildableExt, CellEditableExt, CellLayoutExt, ComboBoxExtManual, WidgetExtManual, BuildableExtManual

Implementations

impl ComboBox[src]

pub fn new() -> ComboBox[src]

Creates a new empty ComboBox.

Returns

A new ComboBox.

pub fn with_area<P: IsA<CellArea>>(area: &P) -> ComboBox[src]

pub fn with_area_and_entry<P: IsA<CellArea>>(area: &P) -> ComboBox[src]

pub fn with_entry() -> ComboBox[src]

pub fn with_model<P: IsA<TreeModel>>(model: &P) -> ComboBox[src]

pub fn with_model_and_entry<P: IsA<TreeModel>>(model: &P) -> ComboBox[src]

Trait Implementations

impl Clone for ComboBox

impl Debug for ComboBox

impl Default for ComboBox[src]

impl Display for ComboBox[src]

impl Eq for ComboBox

impl Hash for ComboBox

impl IsA<Bin> for ComboBox

impl IsA<Buildable> for ComboBox

impl IsA<CellEditable> for ComboBox

impl IsA<CellLayout> for ComboBox

impl IsA<ComboBox> for AppChooserButton

impl IsA<ComboBox> for ComboBoxText

impl IsA<Container> for ComboBox

impl IsA<Widget> for ComboBox

impl Ord for ComboBox

impl<T: ObjectType> PartialEq<T> for ComboBox

impl<T: ObjectType> PartialOrd<T> for ComboBox

impl StaticType for ComboBox

Auto Trait Implementations

impl RefUnwindSafe for ComboBox

impl !Send for ComboBox

impl !Sync for ComboBox

impl Unpin for ComboBox

impl UnwindSafe for ComboBox

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.