[][src]Struct druid::widget::Click

pub struct Click<T> { /* fields omitted */ }

A clickable Controller widget. Pass this and a child widget to a ControllerHost to make the child interactive. More conveniently, this is available as an on_click method via WidgetExt'.

This is an alternative to the standard Button widget, for when you want to make an arbitrary widget clickable.

The child widget will also be updated on LifeCycle::HotChanged and mouse down, which can be useful for painting based on ctx.is_active() and ctx.is_hot().

Implementations

impl<T: Data> Click<T>[src]

pub fn new(action: impl Fn(&mut EventCtx, &mut T, &Env) + 'static) -> Self[src]

Create a new clickable Controller widget.

Trait Implementations

impl<T: Data, W: Widget<T>> Controller<T, W> for Click<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Click<T>

impl<T> !Send for Click<T>

impl<T> !Sync for Click<T>

impl<T> Unpin for Click<T>

impl<T> !UnwindSafe for Click<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.