Skip to content

Easiest way to force a refresh every x milliseconds #342

Answered by follower
AyashiNoCeres asked this question in Q&A
Discussion options

You must be logged in to vote

It wasn't clear to me if you specifically wanted a refresh/repaint that was not every frame--but if "a refresh/repaint every frame " is okay then you can use request_repaint() in your update() method, as used in some of the demos, e.g.:

// we want continuous UI updates, so the circle can smoothly follow the arrow's origin:
ui.ctx().request_repaint();

and

/// How often we repaint the demo app by default
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum RunMode {
/// This is the default for the demo.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@AyashiNoCeres
Comment options

Comment options

You must be logged in to vote
2 replies
@AyashiNoCeres
Comment options

@nalply
Comment options

Answer selected by AyashiNoCeres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants