[−][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
pub fn configure(&mut self, _: &mut Manager<'_>)
[src]
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.
It is not advised to perform any action requiring a reconfigure (e.g. adding a child widget) during configure due to the possibility of getting stuck in a reconfigure-loop. See issue kas#91 for more on this. KAS has a crude mechanism to detect this and panic.
The default implementation of this method does nothing.
pub fn configure_recurse<'a, 'b>(&mut self, cmgr: ConfigureManager<'a, 'b>)
[src]
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.
pub fn key_nav(&self) -> bool
[src]
Is this widget navigable via Tab key?
Defaults to false
.
pub fn cursor_icon(&self) -> CursorIcon
[src]
Which cursor icon should be used on hover?
Defaults to event::CursorIcon::Default
.