[−][src]Struct druid::widget::Button
A button with a text label.
Fields
id: WidgetIdlabel: Label<T>action: fn(_: &mut EventCtx<T>, _: &mut T, _: &Env)Methods
impl<T: Data + 'static + Default> Button<T>[src]
pub fn new(
text: impl Into<LabelText<T>>,
action: fn(_: &mut EventCtx<T>, _: &mut T, _: &Env)
) -> Button<T>[src]
text: impl Into<LabelText<T>>,
action: fn(_: &mut EventCtx<T>, _: &mut T, _: &Env)
) -> Button<T>
Create a new button. The closure provided will be called when the button is clicked.
Trait Implementations
impl<T: Clone + Data + 'static + Default> Clone for Button<T>[src]
fn clone(&self) -> Button<T>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<T: Data + 'static + Default> Widget<T> for Button<T>[src]
fn paint(
&mut self,
paint_ctx: &mut PaintCtx,
base_state: &BaseState,
data: &T,
env: &Env
)[src]
&mut self,
paint_ctx: &mut PaintCtx,
base_state: &BaseState,
data: &T,
env: &Env
)
fn layout(
&mut self,
layout_ctx: &mut LayoutCtx,
bc: &BoxConstraints,
data: &T,
env: &Env
) -> Size[src]
&mut self,
layout_ctx: &mut LayoutCtx,
bc: &BoxConstraints,
data: &T,
env: &Env
) -> Size
fn event(
&mut self,
ctx: &mut EventCtx<T>,
event: &Event,
data: &mut T,
env: &Env
)[src]
&mut self,
ctx: &mut EventCtx<T>,
event: &Event,
data: &mut T,
env: &Env
)
fn update(
&mut self,
ctx: &mut UpdateCtx<T>,
old_data: Option<&T>,
data: &T,
env: &Env
)[src]
&mut self,
ctx: &mut UpdateCtx<T>,
old_data: Option<&T>,
data: &T,
env: &Env
)
fn to_type(self) -> WidgetType<T>[src]
fn new_window(self) -> WindowBox<T>[src]
fn get_id(self) -> WidgetId[src]
Auto Trait Implementations
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[src]
fn round_from(x: T) -> T[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>, [src]
U: RoundFrom<T>,
fn round_into(self) -> U[src]
impl<T> Same<T> for T[src]
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>,