Skip to content

Commit

Permalink
Merge pull request #12 from sundaram123krishnan/master
Browse files Browse the repository at this point in the history
Adding basic sandbox implementation
  • Loading branch information
andrewdavidmackenzie authored May 13, 2024
2 parents 4a9ec10 + af8e7aa commit 06e5d8f
Showing 1 changed file with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions src/piggui.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


/// When built with the "rppal" feature for interacting with GPIO - can only be built for RPi
#[cfg(feature = "rppal")]
use rppal;
Expand All @@ -8,6 +6,42 @@ use rppal;
#[cfg(feature = "iced")]
use iced;

fn main() {
println!("OINK");
}
use iced::widget::text;
use iced::{window, Element, Sandbox, Settings};

fn main() -> Result<(), iced::Error> {
let window = window::Settings {
resizable: false,
..Default::default()
};

Gpio::run(Settings {
window,
..Default::default()
})
}

struct Gpio;

#[derive(Debug)]
enum Message {}

impl Sandbox for Gpio {
type Message = Message;

fn new() -> Self {
Self
}

fn title(&self) -> String {
String::from("Pigg")
}

fn update(&mut self, message: Message) {
match message {}
}
fn view(&self) -> Element<'_, Message> {
text("Hello iced").into()
}
}

0 comments on commit 06e5d8f

Please sign in to comment.