LabelColumn

Trait LabelColumn 

Source
pub trait LabelColumn: 'static {
    type Item: Any;
    type Value: PartialOrd + Display;

    const COLUMN_NAME: &'static str;
    const ENABLE_SORT: bool;
    const ENABLE_RESIZE: bool = false;
    const ENABLE_EXPAND: bool = false;

    // Required method
    fn get_cell_value(item: &Self::Item) -> Self::Value;

    // Provided method
    fn format_cell_value(value: &Self::Value) -> String { ... }
}
Expand description

Simplified trait for creating columns with only one gtk::Label widget per-entry (i.e. a text cell)

Required Associated Constants§

Source

const COLUMN_NAME: &'static str

Name of the column

Source

const ENABLE_SORT: bool

Whether to enable the sorting for this column

Provided Associated Constants§

Source

const ENABLE_RESIZE: bool = false

Whether to enable resizing for this column

Source

const ENABLE_EXPAND: bool = false

Whether to enable automatic expanding for this column

Required Associated Types§

Source

type Item: Any

Item of the model

Source

type Value: PartialOrd + Display

Value of the column

Required Methods§

Source

fn get_cell_value(item: &Self::Item) -> Self::Value

Get the value that this column represents.

Provided Methods§

Source

fn format_cell_value(value: &Self::Value) -> String

Format the value for presentation in the text cell.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§