Skip to content

Commit

Permalink
Init sandbox example
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxxcode committed Jan 8, 2024
1 parent b4f2713 commit 70a82dc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[workspace]
members = [
"examples/*"
]

[package]
name = "egui-file-explorer"
version = "0.1.0"
Expand Down
10 changes: 10 additions & 0 deletions examples/sandbox/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "sandbox"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
egui = "0.25.0"
eframe = { version = "0.25.0", default-features = false, features = ["glow"] }
23 changes: 23 additions & 0 deletions examples/sandbox/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

struct MyApp;

impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("My egui application");
});
}
}

fn main() -> eframe::Result<()> {
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default() .with_inner_size([1080.0, 720.0]),
..Default::default()
};

eframe::run_native(
"My egui application",
options,
Box::new(|_| Box::new(MyApp{ }))
)
}

0 comments on commit 70a82dc

Please sign in to comment.