chore: Adds hello world.
This commit is contained in:
parent
510959df46
commit
6063a541d5
3 changed files with 40 additions and 4 deletions
|
@ -6,3 +6,5 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
eframe = "0.27.2"
|
||||
egui = "0.27.2"
|
||||
|
|
|
@ -1,3 +1,28 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
use eframe::egui;
|
||||
|
||||
fn main() -> Result<(), eframe::Error> {
|
||||
let options = eframe::NativeOptions {
|
||||
viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
// Our application state:
|
||||
let mut name = "Arthur".to_owned();
|
||||
let mut age = 42;
|
||||
|
||||
eframe::run_simple_native("My egui App", options, move |ctx, _frame| {
|
||||
egui::CentralPanel::default().show(ctx, |ui| {
|
||||
ui.heading("My egui Application");
|
||||
ui.horizontal(|ui| {
|
||||
let name_label = ui.label("Your name: ");
|
||||
ui.text_edit_singleline(&mut name)
|
||||
.labelled_by(name_label.id);
|
||||
});
|
||||
ui.add(egui::Slider::new(&mut age, 0..=120).text("age"));
|
||||
if ui.button("Increment").clicked() {
|
||||
age += 1;
|
||||
}
|
||||
ui.label(format!("Hello '{name}', age {age}"));
|
||||
});
|
||||
})
|
||||
}
|
11
shell.nix
11
shell.nix
|
@ -11,13 +11,22 @@
|
|||
openssl
|
||||
postgresql
|
||||
lsof
|
||||
];
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export PRISMA_QUERY_ENGINE_BINARY=${pkgs.prisma-engines}/bin/query-engine
|
||||
export PRISMA_QUERY_ENGINE_LIBRARY=${pkgs.prisma-engines}/lib/libquery_engine.node
|
||||
export PRISMA_SCHEMA_ENGINE_BINARY=${pkgs.prisma-engines}/bin/schema-engine
|
||||
|
||||
# egui patches!
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.wayland}/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.libxkbcommon}/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.xorg.libX11}/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.xorg.libXcursor}/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.xorg.libXrandr}/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.xorg.libXi}/lib
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.libGL}/lib
|
||||
|
||||
source init.sh
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue