[−][src]Trait kas::prelude::WidgetCore
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
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.
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
.