pub struct Button;Expand description
A push button. Its children (usually a text label) are laid out in a row, so an icon element can sit next to the text.
Fires click on a pointer release over the button, on Enter or Space
while focused, and when its shortcut is pressed.
Trait Implementations§
Source§impl<M: 'static> Widget<M> for Button
impl<M: 'static> Widget<M> for Button
Source§fn axis(&self) -> Option<Axis>
fn axis(&self) -> Option<Axis>
Some for a container: the direction it lays its children out in.Source§fn event(&mut self, cx: &mut EventCx<'_, M>, event: &Event) -> bool
fn event(&mut self, cx: &mut EventCx<'_, M>, event: &Event) -> bool
Handles an event aimed at this element. Returning
true stops the
event from bubbling to the parent.fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Source§fn set_attribute(&mut self, name: &str, value: &str) -> bool
fn set_attribute(&mut self, name: &str, value: &str) -> bool
Takes an attribute from the element description, returning
false
for one the widget does not know. id, class, style, grow,
align, disabled, shortcut and state never reach here.Source§fn measure(&self, fonts: &dyn Fonts, style: &ComputedStyle) -> Size
fn measure(&self, fonts: &dyn Fonts, style: &ComputedStyle) -> Size
The natural size of the widget’s own content, without padding or
border. Containers are measured from their children instead.
Source§fn state(&self) -> ElementState
fn state(&self) -> ElementState
State the widget owns, such as
CHECKED, merged into the element’s
state for styling.Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnsafeUnpin for Button
impl UnwindSafe for Button
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more