Search code examples
fltk

create custom fltk dialog / modal window


I want to create a custom dialog window with fltk. I will put the widgets. Background process should wait to the dialog's finish. I couldn't find any example for this. I am looking fl_input function. I found makeform() function but it didn't help very much.


Solution

  • I found innate() function in the library. In the function there is a line following:

    while (w->shown()) Fl::wait();
    

    this is my solution. For example:

    Fl_Window* w = new Fl_Window(400, 300);
    w->set_modal();
    w->show();
    while (w->shown()) Fl::wait();
    

    will wait the user to close the window.