[][src]Trait kas::WidgetCore

pub trait WidgetCore: Any + Debug {
    fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn core_data(&self) -> &CoreData;
fn widget_name(&self) -> &'static str;
fn as_widget(&self) -> &dyn WidgetConfig;
fn as_widget_mut(&mut self) -> &mut dyn WidgetConfig; fn id(&self) -> WidgetId { ... }
fn is_disabled(&self) -> bool { ... }
fn set_disabled(&mut self, disabled: bool) -> TkAction { ... }
fn rect(&self) -> Rect { ... }
fn input_state(&self, mgr: &ManagerState, disabled: bool) -> InputState { ... } }

Base widget functionality

See the Widget trait for documentation of the widget family.

This trait must be implement by the derive(Widget) macro. Users must not implement this WidgetCore trait manually or may face unexpected breaking changes.

Required methods

fn as_any(&self) -> &dyn Any

Get self as type Any

fn as_any_mut(&mut self) -> &mut dyn Any

Get self as type Any (mutable)

fn core_data(&self) -> &CoreData

Get direct access to the CoreData providing property storage.

fn widget_name(&self) -> &'static str

Get the name of the widget struct

fn as_widget(&self) -> &dyn WidgetConfig

Erase type

fn as_widget_mut(&mut self) -> &mut dyn WidgetConfig

Erase type

Loading content...

Provided methods

fn id(&self) -> WidgetId

Get the widget's numeric identifier

fn is_disabled(&self) -> bool

Get whether the widget is disabled

fn set_disabled(&mut self, disabled: bool) -> TkAction

Get the disabled state of a widget

If disabled, a widget should not respond to input and should appear greyed out.

The disabled status is inherited by children: events should not be passed to them, and they should also be drawn greyed out.

fn rect(&self) -> Rect

Get the widget's region, relative to its parent.

fn input_state(&self, mgr: &ManagerState, disabled: bool) -> InputState

Construct InputState

The disabled flag is inherited from parents. InputState::disabled will be true if either disabled or self.is_disabled() are true.

The error state defaults to false since most widgets don't support this.

Loading content...

Methods

impl dyn WidgetCore[src]

pub fn is<T: Any>(&self) -> bool[src]

Forwards to the method defined on the type Any.

pub fn downcast_ref<T: Any>(&self) -> Option<&T>[src]

Forwards to the method defined on the type Any.

pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>[src]

Forwards to the method defined on the type Any.

Implementations on Foreign Types

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

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

Loading content...

Implementors

impl WidgetCore for AccelLabel[src]

impl WidgetCore for DragHandle[src]

impl WidgetCore for Filler[src]

impl WidgetCore for Label[src]

impl WidgetCore for MessageBox[src]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

impl<W: Widget + 'static> WidgetCore for Window<W>[src]

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

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

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

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

Loading content...