You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to integrate egui into an existing large singlepage application written in javascript/typescript.
The javascript/typescript app may change the state of the application outside of what rust/egui is aware.
(I.e. for example I use egui to visualize some data and the js part changes the data)
Rust would have to be notified somehow that a repaint is required.
Describe the solution you'd like
It would be easiest to just be able to call WebRunner::request_repaint or something similar.
This would/should cause the Apps update routine to be called without any mouse/input events on the canvas
causing rust to become aware of any changes in state and updating the UI accordingly.
To call this from JS, I could then expose a fn to javascript that would call WebRunner::request_repaint.
Describe alternatives you've considered
A workaround exists as the egui::Context object has a repaint method and the WebRunner has the app.
First I added the egui::Context as a member to my App Struct (Thankfully its just an Arc to a Context delegate!)
Then on the WebRunner in the exposed fn I call
let runner :&WebRunner = .......
runner.app_mut::<MyAppStructNameHere>().map(|app| app.repaint())
In the impl of my App:
pubfnrepaint(&self){self.ctx.request_repaint();}
As you can see this is not a very intuitive way to do this.
Additional context
There may be a more obvieus, easy/intended way of doing this, that I just haven't seen.
If that is the case then I am sorry for wasting your time.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to integrate egui into an existing large singlepage application written in javascript/typescript.
The javascript/typescript app may change the state of the application outside of what rust/egui is aware.
(I.e. for example I use egui to visualize some data and the js part changes the data)
Rust would have to be notified somehow that a repaint is required.
Describe the solution you'd like
It would be easiest to just be able to call WebRunner::request_repaint or something similar.
This would/should cause the Apps update routine to be called without any mouse/input events on the canvas
causing rust to become aware of any changes in state and updating the UI accordingly.
To call this from JS, I could then expose a fn to javascript that would call WebRunner::request_repaint.
Describe alternatives you've considered
A workaround exists as the egui::Context object has a repaint method and the WebRunner has the app.
First I added the egui::Context as a member to my App Struct (Thankfully its just an Arc to a Context delegate!)
Then on the WebRunner in the exposed fn I call
In the impl of my App:
As you can see this is not a very intuitive way to do this.
Additional context
There may be a more obvieus, easy/intended way of doing this, that I just haven't seen.
If that is the case then I am sorry for wasting your time.
The text was updated successfully, but these errors were encountered: