feat: add sciter
This commit is contained in:
27
__gui/sciter/src/main.rs
Normal file
27
__gui/sciter/src/main.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
#![windows_subsystem = "windows"]
|
||||
extern crate sciter;
|
||||
|
||||
// https://github.com/sciter-sdk/rust-sciter/blob/master/examples/minimal.rs
|
||||
fn main() {
|
||||
// let app_bytes = include_bytes!("app.htm");
|
||||
|
||||
// sciter::set_options(sciter::RuntimeOptions::ScriptFeatures(
|
||||
// sciter::SCRIPT_RUNTIME_FEATURES::ALLOW_SYSINFO as u8 // Enables `Sciter.machineName()`. Required for opening file dialog (`view.selectFile()`)
|
||||
// | sciter::SCRIPT_RUNTIME_FEATURES::ALLOW_FILE_IO as u8 // Enables opening file dialog (`view.selectFile()`)
|
||||
// )).unwrap();
|
||||
|
||||
let mut frame = sciter::Window::new();
|
||||
|
||||
if cfg!(target_os="macos") {
|
||||
// a temporary workaround for OSX, see
|
||||
// https://sciter.com/forums/topic/global-sciter_set_debug_mode-does-not-work-in-osx/
|
||||
frame.set_options(sciter::window::Options::DebugMode(true)).unwrap();
|
||||
}
|
||||
|
||||
let favicon_bytes = include_bytes!("assets.rc");
|
||||
frame.archive_handler(favicon_bytes).expect("Error load assets.rc!");
|
||||
|
||||
frame.load_file("this://app/app.htm");
|
||||
// frame.load_html(app_bytes, Some("app://app.htm"));
|
||||
frame.run_app();
|
||||
}
|
||||
Reference in New Issue
Block a user