[−][src]Trait kas::WidgetConfig
Widget configuration
This trait is part of the Widget
family and is derived by
derive(Widget)
unless #[widget(config = noauto)]
is used.
key_nav
and cursor_icon
may be customised without a manual
implementation (e.g. #[widget(config(key_nav = true))]
).
This trait allows some configuration of widget behaviour. All methods have
default implementations. Most frequently, this trait is used to implement
some custom action during configure: WidgetConfig::configure
.
Provided methods
fn configure(&mut self, _: &mut Manager)
Configure widget
Widgets are configured on window creation and when
TkAction::Reconfigure
is sent.
Configure is called before resizing (but after calculation of the
initial window size). This method is called after
a WidgetId
has been assigned to self, and after configure
has
been called on each child.
The default implementation of this method does nothing.
fn configure_recurse<'a, 'b>(&mut self, cmgr: ConfigureManager<'a, 'b>)
Configure self and children
In most cases one should not override the default implementation of this
method but instead use WidgetConfig::configure
; the exception is
widgets with pop-ups.
fn key_nav(&self) -> bool
Is this widget navigable via Tab key?
Defaults to false
.
fn cursor_icon(&self) -> CursorIcon
Which cursor icon should be used on hover?
Defaults to event::CursorIcon::Default
.