sciter-sdk / rust-sciter

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

quick.js has been used by sciter-js-sdk #113

Closed fuyoo closed 3 years ago

fuyoo commented 3 years ago

Those tis based examples don't work in the new SDK. Do you have any plans to adapt the new SDK?

fuyoo commented 3 years ago

i'm can't find a way to call the rust func in the javascript file..

i am try interop example

const view = Window.this 
view. calc_sum()

the console tell me method undefined.

superblaubeere27 commented 3 years ago

How did you solve this?

fuyoo commented 3 years ago

How did you solve this?

at the rust side impl

impl sciter::EventHandler for EventHandler {
  fn get_subscription(&mut self) -> Option<sciter::dom::event::EVENT_GROUPS> {
    Some(sciter::dom::event::default_events() | sciter::dom::event::EVENT_GROUPS::HANDLE_METHOD_CALL)
}

at the view side:

const view = Window.this
view.xcall("sum",1, 2);

detail at here #96

and the sciter.js doc at here doc

pravic commented 3 years ago

default_events() should be adjusted to cover JS. Will do.

fuyoo commented 3 years ago

default_events() should be adjusted to cover JS. Will do.

that's great, thank's a lot!

SonnyX commented 3 years ago

Might be nice to release the version with the fix on crates.io :)