[][src]Trait orbtk_api::widget_base::Widget

pub trait Widget: Template {
    fn new() -> Self;
fn build(self, ctx: &mut BuildContext<'_>) -> Entity;
fn insert_handler(self, handler: impl Into<Rc<dyn EventHandler>>) -> Self;
fn child(self, child: Entity) -> Self; fn create() -> Self { ... }
fn attach<P: Component + Debug>(self, _: AttachedProperty<P>) -> Self { ... } }

The Widget trait is used to define a new widget.

Required methods

fn new() -> Self

Creates a new widget.

fn build(self, ctx: &mut BuildContext<'_>) -> Entity

Builds the widget and returns the template of the widget.

fn insert_handler(self, handler: impl Into<Rc<dyn EventHandler>>) -> Self

Inerts a new event handler.

fn child(self, child: Entity) -> Self

Appends a child to the widget.

Loading content...

Provided methods

fn create() -> Self

👎 Deprecated:

Use new instead

Creates a new widget.

fn attach<P: Component + Debug>(self, _: AttachedProperty<P>) -> Self

Loading content...

Implementors

impl Widget for Overlay[src]

fn new() -> Self[src]

Creates a new widget.

Loading content...