Trait tuix_internal::events::Widget [−][src]
pub trait Widget: 'static {
type Ret: AsEntity;
type Data: Node;
fn on_build(&mut self, state: &mut State, entity: Entity) -> Self::Ret;
fn widget_name(&self) -> String { ... }
fn build<F>(
self,
state: &mut State,
parent: impl AsEntity,
builder: F
) -> Self::Ret
where
Self: 'static,
F: FnMut(Builder<'_, Self>) -> Builder<'_, Self>,
{ ... }
fn bind<L, F>(self, lens: L, converter: F) -> Wrapper<L, Self>
where
L: Lens,
F: 'static + Fn(&<L as Lens>::Target) -> Self::Data,
{ ... }
fn bind2<L>(self, lens: L) -> LensWrap<L, Self>
where
L: Lens,
{ ... }
fn on_update(
&mut self,
state: &mut State,
entity: Entity,
data: &Self::Data
) { ... }
fn on_event(&mut self, state: &mut State, entity: Entity, event: &mut Event) { ... }
fn on_style(
&mut self,
state: &mut State,
entity: Entity,
property: (String, PropType)
) { ... }
fn on_draw(
&mut self,
state: &mut State,
entity: Entity,
canvas: &mut Canvas<OpenGl>
) { ... }
}
Associated Types
Required methods
Provided methods
fn widget_name(&self) -> String
Adds the widget into state and returns the associated type Ret - an entity id or a tuple of entity ids