[][src]Trait ganache::Widget

pub trait Widget<C: Context>: Downcast {
    fn kind_id(&self) -> &'static str;
fn takes_focus(&self) -> bool;
fn minimum_size(&self, args: MinimumSizeArgs<C>) -> Dimensions;
fn layout_children(&self, args: LayoutChildrenArgs<C>);
fn process_event(&mut self, args: ProcessEventArgs<C>) -> ProcessEventResult;
fn draw(&self, args: DrawArgs<C>); }

Required methods

fn kind_id(&self) -> &'static str

fn takes_focus(&self) -> bool

fn minimum_size(&self, args: MinimumSizeArgs<C>) -> Dimensions

The minimum size that this widget's slot can shrink to.

fn layout_children(&self, args: LayoutChildrenArgs<C>)

fn process_event(&mut self, args: ProcessEventArgs<C>) -> ProcessEventResult

fn draw(&self, args: DrawArgs<C>)

Loading content...

Methods

impl<C> dyn Widget<C> where
    C: Any + 'static,
    C: Context

pub fn is<__T: Widget<C>>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: Widget<C>>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn't.

pub fn downcast_ref<__T: Widget<C>>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn't.

pub fn downcast_mut<__T: Widget<C>>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn't.

Implementors

Loading content...