pub struct Button {
pub id: &'static str,
/* private fields */
}Expand description
A struct of button for interact with the GUI.
Fields
id: &'static strThe id is not unique, it’s just a name to identify it.
Implementations
sourceimpl Button
impl Button
sourcepub fn new(
id: &'static str,
enable: bool,
rect: Rect,
color: Color,
text: &'static str,
align: Align,
func: Option<fn(_: &mut ChessGui)>
) -> Self
pub fn new(
id: &'static str,
enable: bool,
rect: Rect,
color: Color,
text: &'static str,
align: Align,
func: Option<fn(_: &mut ChessGui)>
) -> Self
Create a new Button.
sourcepub fn set_image(&mut self, path: Option<&'static str>) -> Self
pub fn set_image(&mut self, path: Option<&'static str>) -> Self
Draw the image at the given path rather than a rectangle.
Trait Implementations
impl Copy for Button
Auto Trait Implementations
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more