[][src]Trait kas::WidgetConfig

pub trait WidgetConfig: Layout {
    fn configure(&mut self, _: &mut Manager) { ... }
fn configure_recurse<'a, 'b>(&mut self, cmgr: ConfigureManager<'a, 'b>) { ... }
fn key_nav(&self) -> bool { ... }
fn cursor_icon(&self) -> CursorIcon { ... } }

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.

Loading content...

Implementations on Foreign Types

impl<M: 'static> WidgetConfig for Box<dyn Widget<Msg = M>>[src]

impl<M: 'static> WidgetConfig for Box<dyn Menu<Msg = M>>[src]

Loading content...

Implementors

impl WidgetConfig for AccelLabel[src]

impl WidgetConfig for DragHandle[src]

impl WidgetConfig for Filler[src]

impl WidgetConfig for Label[src]

impl WidgetConfig for MessageBox[src]

impl<D: Directional> WidgetConfig for ScrollBar<D>[src]

impl<D: Directional, W: Widget> WidgetConfig for List<D, W>[src]

impl<D: Directional, W: Widget> WidgetConfig for Splitter<D, W>[src]

impl<D: Directional, W: Menu> WidgetConfig for MenuBar<D, W>[src]

impl<D: Directional, W: Menu> WidgetConfig for SubMenu<D, W>[src]

impl<G: 'static> WidgetConfig for EditBox<G>[src]

impl<M: 'static> WidgetConfig for CheckBox<M>[src]

impl<M: 'static> WidgetConfig for CheckBoxBare<M>[src]

impl<M: 'static> WidgetConfig for MenuToggle<M>[src]

impl<M: 'static> WidgetConfig for RadioBox<M>[src]

impl<M: 'static> WidgetConfig for RadioBoxBare<M>[src]

impl<M: Clone + Debug + 'static> WidgetConfig for ComboBox<M>[src]

impl<M: Clone + Debug + 'static> WidgetConfig for MenuEntry<M>[src]

impl<M: Clone + Debug + 'static> WidgetConfig for TextButton<M>[src]

impl<M: Debug + 'static> WidgetConfig for Separator<M>[src]

impl<T: SliderType, D: Directional> WidgetConfig for Slider<T, D>[src]

impl<W: Widget> WidgetConfig for Frame<W>[src]

impl<W: Widget> WidgetConfig for MenuFrame<W>[src]

impl<W: Widget> WidgetConfig for ScrollRegion<W>[src]

impl<W: Widget> WidgetConfig for Stack<W>[src]

impl<W: Widget> WidgetConfig for Window<W>[src]

Loading content...