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
Hi all, how should I repaint the UI if the return value from a function changes? I've attempted the below, but if there is no mouse movement for a few seconds, and hence no repaints being called for, then it stops. Using the delayed repaint method works better, but still stalls out after some time. If there are more structural changes needed, then the full codebase is at https://github.com/zax71/technus-timecode to reference.
#[derive(Default,Serialize,Deserialize)]pubstructTimecodeDisplay{current_timecode:Timecode,}implTimecodeDisplay{pubfnadd(&mutself,ctx:&egui::Context,ui:&mut egui::Ui,global_state:&mutGlobalState){
ui.label(format!("{}",self.current_timecode));// Update the cached timecode value if there is an updateifletSome(tc) = global_state.mtc_decoder.get_current_timecode(){self.current_timecode = tc;
ctx.request_repaint();// Keep the timecode updating even when there is no user input}}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, how should I repaint the UI if the return value from a function changes? I've attempted the below, but if there is no mouse movement for a few seconds, and hence no repaints being called for, then it stops. Using the delayed repaint method works better, but still stalls out after some time. If there are more structural changes needed, then the full codebase is at https://github.com/zax71/technus-timecode to reference.
Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions