mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
24 lines
652 B
Rust
24 lines
652 B
Rust
use structopt::StructOpt;
|
|
|
|
#[derive(StructOpt)]
|
|
struct Cli {
|
|
#[structopt(name = "path to .60 file", parse(from_os_str))]
|
|
path: std::path::PathBuf,
|
|
}
|
|
|
|
fn main() -> std::io::Result<()> {
|
|
let args = Cli::from_args();
|
|
let source = std::fs::read_to_string(&args.path)?;
|
|
let c = match sixtyfps_interpreter::load(source, &args.path) {
|
|
Ok(c) => c,
|
|
Err(diag) => {
|
|
diag.print();
|
|
std::process::exit(-1);
|
|
}
|
|
};
|
|
|
|
let window = sixtyfps_rendering_backend_gl::create_gl_window();
|
|
let component = c.create();
|
|
window.run(component.borrow(), &component.window_properties());
|
|
Ok(())
|
|
}
|