Function remove_timeout

Source
pub fn remove_timeout(handle: TimeoutHandle)
Expand description

Removes the timeout callback associated with the handle

use fltk::{prelude::*, *};
fn main() {
    let callback = |handle| {
        println!("FIRED");
    };

    let app = app::App::default();
    let mut wind = window::Window::new(100, 100, 400, 300, "");
    wind.show();
    let handle = app::add_timeout(1.0, callback);
    app::remove_timeout(handle);
    app.run().unwrap();
}
Examples found in repository?
examples/animations.rs (line 50)
45fn move_image(mut frm: Frame, handle: app::TimeoutHandle) {
46    let (x, y) = (frm.x(), frm.y());
47    frm.resize(x + 5, y, frm.w(), frm.h());
48    app::redraw();
49    if frm.x() > 260 {
50        app::remove_timeout(handle)
51    } else {
52        app::repeat_timeout(0.016, handle);
53    }
54}