[−][src]Struct druid::widget::Click
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]
fn event(
&mut self,
child: &mut W,
ctx: &mut EventCtx,
event: &Event,
data: &mut T,
env: &Env
)
[src]
&mut self,
child: &mut W,
ctx: &mut EventCtx,
event: &Event,
data: &mut T,
env: &Env
)
fn lifecycle(
&mut self,
child: &mut W,
ctx: &mut LifeCycleCtx,
event: &LifeCycle,
data: &T,
env: &Env
)
[src]
&mut self,
child: &mut W,
ctx: &mut LifeCycleCtx,
event: &LifeCycle,
data: &T,
env: &Env
)
fn update(
&mut self,
child: &mut W,
ctx: &mut UpdateCtx,
old_data: &T,
data: &T,
env: &Env
)
[src]
&mut self,
child: &mut W,
ctx: &mut UpdateCtx,
old_data: &T,
data: &T,
env: &Env
)
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
fn round_into(self) -> U
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,