pub trait ComboRowExt: IsA<ComboRow> + Sealed + 'static {
    // Provided methods
    fn bind_name_model(
        &self,
        model: Option<&impl IsA<ListModel>>,
        get_name_func: Option<Box_<dyn Fn(&Object) -> String + 'static>>
    ) { ... }
    fn model(&self) -> Option<ListModel> { ... }
    fn selected_index(&self) -> i32 { ... }
    fn uses_subtitle(&self) -> bool { ... }
    fn set_for_enum(
        &self,
        enum_type: Type,
        get_name_func: Option<Box_<dyn Fn(&EnumValueObject) -> String + 'static>>
    ) { ... }
    fn set_get_name_func(
        &self,
        get_name_func: Option<Box_<dyn Fn(&Object) -> String + 'static>>
    ) { ... }
    fn set_selected_index(&self, selected_index: i32) { ... }
    fn set_use_subtitle(&self, use_subtitle: bool) { ... }
    fn connect_selected_index_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId { ... }
    fn connect_use_subtitle_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all ComboRow methods.

Implementors

ComboRow

Provided Methods§

source

fn bind_name_model( &self, model: Option<&impl IsA<ListModel>>, get_name_func: Option<Box_<dyn Fn(&Object) -> String + 'static>> )

Binds @model to @self.

If @self was already bound to a model, that previous binding is destroyed.

The contents of @self are cleared and then filled with widgets that represent items from @model. @self is updated whenever @model changes. If @model is NULL, @self is left empty.

This is more convenient to use than ComboRow::bind_model() if you want to represent items of the model with names.

model

the [gio::ListModel][crate::gio::ListModel] to be bound to @self

get_name_func

a function that creates names for items, or NULL in case you also passed NULL as @model

source

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

Gets the model bound to @self.

Returns

the [gio::ListModel][crate::gio::ListModel] bound to @self

source

fn selected_index(&self) -> i32

Gets the index of the selected item in its [gio::ListModel][crate::gio::ListModel].

Returns

the index of the selected item, or -1 if no item is selected

source

fn uses_subtitle(&self) -> bool

Gets whether the current value of @self should be displayed as its subtitle.

Returns

whether the current value of @self should be displayed as its subtitle

source

fn set_for_enum( &self, enum_type: Type, get_name_func: Option<Box_<dyn Fn(&EnumValueObject) -> String + 'static>> )

Creates a model for @enum_type and binds it to @self.

The items of the model will be EnumValueObject objects.

If @self was already bound to a model, that previous binding is destroyed.

The contents of @self are cleared and then filled with widgets that represent items from @model. @self is updated whenever @model changes. If @model is NULL, @self is left empty.

This is more convenient to use than bind_name_model() if you want to represent values of an enumeration with names.

See enum_value_row_name().

enum_type

the enumeration alias::GLib.Type to be bound to @self

get_name_func

a function that creates names for items, or NULL in case you also passed NULL as @model

source

fn set_get_name_func( &self, get_name_func: Option<Box_<dyn Fn(&Object) -> String + 'static>> )

Sets a closure to convert items into names.

See use-subtitle.

get_name_func

a function that creates names for items, or NULL in case you also passed NULL as @model

source

fn set_selected_index(&self, selected_index: i32)

Sets the index of the selected item in its [gio::ListModel][crate::gio::ListModel].

selected_index

the index of the selected item

source

fn set_use_subtitle(&self, use_subtitle: bool)

Sets whether the current value of @self should be displayed as its subtitle.

If TRUE, you should not access subtitle.

use_subtitle

TRUE to set the current value as the subtitle

source

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

source

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<ComboRow>> ComboRowExt for O