From f5e12466ac299b4a813486bc714e4194eb915915 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 21 Jan 2024 15:41:41 +0000 Subject: [PATCH] Make basic iced window --- src/main.rs | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index e7a11a9..640ac5d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,30 @@ -fn main() { - println!("Hello, world!"); +use iced::{widget::text, Element, Result, Sandbox, Settings}; + +#[derive(Debug)] +enum Message {} + +struct Application; + +impl Sandbox for Application { + type Message = Message; + + fn new() -> Self { + Self + } + + fn title(&self) -> String { + String::from("Thief Book Manager") + } + + fn update(&mut self, message: Message) { + match message {} + } + + fn view(&self) -> Element<'_, Message> { + text("Hello, world!").into() + } +} + +fn main() -> Result { + Application::run(Settings::default()) }