[][src]Trait orbtk_widgets::prelude::widget::Widget

pub trait Widget: Template {
    fn create() -> Self;
fn build(self, ctx: &mut BuildContext) -> Entity;
fn insert_handler(
        self,
        handler: impl Into<Rc<dyn EventHandler + 'static>>
    ) -> Self;
fn child(self, child: Entity) -> Self; fn state(&self) -> Option<Rc<dyn State + 'static>> { ... } }

The Widget trait is used to define a new widget.

Required methods

fn create() -> 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 + 'static>>
) -> Self

Inerts a new event handler.

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

Appends a child ot the widget.

Loading content...

Provided methods

fn state(&self) -> Option<Rc<dyn State + 'static>>

Returns the state of the widget.

Loading content...

Implementors

impl Widget for FocusBehavior

impl Widget for MouseBehavior

impl Widget for SelectionBehavior

impl Widget for Button

impl Widget for Canvas

impl Widget for CheckBox

impl Widget for Container

impl Widget for Cursor

impl Widget for FontIconBlock

impl Widget for Grid

impl Widget for ImageWidget

impl Widget for ItemsWidget

impl Widget for ListView

impl Widget for ListViewItem

impl Widget for ScrollBar

impl Widget for ScrollIndicator

impl Widget for ScrollViewer

impl Widget for Stack

impl Widget for Switch

impl Widget for TextBlock

impl Widget for TextBox

impl Widget for ToggleButton

impl Widget for Window

Loading content...