mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-03 07:04:34 +00:00
25 lines
650 B
Rust
25 lines
650 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.as_str(), &args.path) {
|
|
Ok(c) => c,
|
|
Err(diag) => {
|
|
diag.print(source);
|
|
std::process::exit(-1);
|
|
}
|
|
};
|
|
|
|
let component = c.create();
|
|
sixtyfps_rendering_backend_gl::sixtyfps_runtime_run_component_with_gl_renderer(
|
|
component.borrow(),
|
|
);
|
|
Ok(())
|
|
}
|