sciter-sdk / rust-sciter

Rust bindings for Sciter
https://sciter.com
MIT License
804 stars 76 forks source link

minimal.rs example is broken on Sciter 4.2.5.0 or newer. #46

Closed 8176135 closed 5 years ago

8176135 commented 5 years ago

Because of 4.2.5.0 disabling some unsafe features by default, the minimal example now

Being new to Sciter I had to stare at some really opaque error messages for a while (which don't even show up by default because #![windows_subsystem = "windows"]) to figure out what's going on.

Do we want to add

sciter::set_options(sciter::RuntimeOptions::ScriptFeatures(
            sciter::SCRIPT_RUNTIME_FEATURES::ALLOW_SYSINFO as u8 |  // Enables Sciter.machineName()
            sciter::SCRIPT_RUNTIME_FEATURES::ALLOW_FILE_IO as u8 | // Enables opening file dialog
            sciter::SCRIPT_RUNTIME_FEATURES::ALLOW_SOCKET_IO as u8)).unwrap(); // Enables connecting to inspector

or should we just remove these things (file opener, machineName(), inspector) from the minimal.rs example.

Personally think showing this early is pretty important, because Sciter's own documentation don't seem to show any of this, and the error messages all just say the functions are undefined.

I'll probably make a PR for this.

pravic commented 5 years ago

Yes, you are right.

I've been thinking about this as well, but probably it'd be better to enable this by default (as I do for debugging) with an ability to opt-out.

ngirard commented 5 years ago

This issue should be closed as fixed.