Function fltk::app::lock

source ·
pub fn lock() -> Result<(), FltkError>
Expand description

Locks the main UI thread

§Errors

Returns FailedToLock if locking is unsupported. This is fatal to the app

Examples found in repository?
examples/terminal.rs (line 1010)
1009
1010
1011
1012
1013
1014
1015
1016
fn error_box(msg: String) {
    fltk::app::lock().unwrap();
    fltk::dialog::message_title("Error");
    fltk::dialog::message_set_hotspot(true);
    fltk::dialog::message_icon_label("!");
    fltk::dialog::message_default(&msg);
    fltk::app::unlock();
}