Trait kas_core::WidgetCore
source · pub trait WidgetCore: Debug {
fn id_ref(&self) -> &WidgetId;
fn rect(&self) -> Rect;
fn widget_name(&self) -> &'static str;
fn as_widget(&self) -> &dyn Widget;
fn as_widget_mut(&mut self) -> &mut dyn Widget;
}
Expand description
Base functionality for Widget
s
Implementing WidgetCore
Implementations of this trait are generated via macro.
Directly implementing this trait is not supported.
See Widget
trait documentation.
Required Methods§
sourcefn id_ref(&self) -> &WidgetId
fn id_ref(&self) -> &WidgetId
Get the widget’s identifier
Note that the default-constructed WidgetId
is invalid: any
operations on this value will cause a panic. Valid identifiers are
assigned by Widget::pre_configure
.
sourcefn widget_name(&self) -> &'static str
fn widget_name(&self) -> &'static str
Get the name of the widget struct
sourcefn as_widget_mut(&mut self) -> &mut dyn Widget
fn as_widget_mut(&mut self) -> &mut dyn Widget
Erase type