Trait kas_widgets::view::driver::Driver [−][src]
pub trait Driver<T>: Debug + 'static {
type Msg;
type Widget: Widget<Msg = Self::Msg>;
fn new(&self) -> Self::Widget;
fn set(&self, widget: &mut Self::Widget, data: T) -> TkAction;
}
Expand description
View widget driver/binder
The controller binds data items with view widgets.
Note that the key type is not made available since in most cases view
widgets are not dependent on the element key. In rare cases where the key
is needed, it must be added to the data’s Item
type (see data-list-view
example).
Several existing implementations are available, most notably:
Default
will choose a sensible widget to view the dataDefaultNav
will choose a sensible widget to view the data
Associated Types
Required methods
Construct a new instance with no data
Such instances are used for sizing and cached widgets, but not shown.
The controller may later call Driver::set
on the widget then show it.