Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pleased add timeout support #85

Closed
brmmm3 opened this issue May 10, 2020 · 2 comments
Closed

Pleased add timeout support #85

brmmm3 opened this issue May 10, 2020 · 2 comments

Comments

@brmmm3
Copy link
Contributor

brmmm3 commented May 10, 2020

Pleased add Support for functions: add_timeout, repeat_timeout and remove_timeout.

@MoAlyousef
Copy link
Collaborator

MoAlyousef commented May 10, 2020

Hi
I have added these methods in the app module. It's currently in the master branch. I've also added an example which mimics the example in the original FLTK docs:

use fltk::*;
use fltk::prelude::*;

fn callback() {
    println!("TICK");
    app::repeat_timeout(1.0, Box::new(callback));
}

fn main() {
    let app = app::App::default();
    let mut wind = window::Window::new(100, 100, 400, 300, "");
    wind.show();
    app::add_timeout(1.0, Box::new(callback));
    app.run().unwrap();
}

@brmmm3
Copy link
Contributor Author

brmmm3 commented May 10, 2020

Many thanks for the very quick improvement!

@brmmm3 brmmm3 closed this as completed May 10, 2020
joseluis pushed a commit to joseluis/fltk-rs that referenced this issue Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants