Add a button type
This commit is contained in:
parent
2a7c035a42
commit
cbbf0bb596
2 changed files with 19 additions and 0 deletions
gui
7
gui/Cargo.lock
generated
Normal file
7
gui/Cargo.lock
generated
Normal file
|
@ -0,0 +1,7 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "gui"
|
||||
version = "0.1.0"
|
|
@ -13,3 +13,15 @@ impl Screen {
|
|||
pub trait Draw {
|
||||
fn draw(&self);
|
||||
}
|
||||
|
||||
pub struct Button {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl Draw for Button {
|
||||
fn draw(&self) {
|
||||
// code to actually draw a button
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue