gui with text

master
Bel LaPointe 2023-03-22 16:58:59 -06:00
parent c70d48d630
commit 54a7befcb9
1 changed files with 10 additions and 1 deletions

View File

@ -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) {
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> {