gui with text
parent
c70d48d630
commit
54a7befcb9
11
src/gui.rs
11
src/gui.rs
|
|
@ -1,5 +1,6 @@
|
|||
use iced::widget::{button, column, text};
|
||||
use iced::{Alignment, Element, Sandbox, Settings};
|
||||
use iced_native::Event;
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
Main::run(Settings::default())
|
||||
|
|
@ -11,6 +12,7 @@ struct Main {
|
|||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
enum ControllerButton {
|
||||
EventOccurred(iced_native::Event),
|
||||
Up,
|
||||
Down,
|
||||
Left,
|
||||
|
|
@ -39,7 +41,14 @@ impl Sandbox for Main {
|
|||
}
|
||||
|
||||
fn update(&mut self, controllerButton: ControllerButton) {
|
||||
self.ntfy = format!("push a key to bind to {:?}", controllerButton);
|
||||
match message {
|
||||
ControllerButton::EventOccurred(Event) => {
|
||||
Err(String::from("ohno")).unwrap();
|
||||
},
|
||||
_ => {
|
||||
self.ntfy = format!("push a key to bind to {:?}", controllerButton);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
fn view(&self) -> Element<ControllerButton> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue