Wininformations is created provisionally to show a msg, and then I want to remove it completely from memory.
I can not make callback recognize WinInformations. So I can close it.
And I also can not keep the window open for a few seconds because using the sleep command the window is not shown before, as it should!
Is it possible to do that?
Thanks!
{ Fl_Window *WinInformations = new Fl_Window(230, 100);
WinInformations->border(0);
WinInformations->position((WinGrid->w() - WinInformations->w())/2 + WinGrid->x(), (WinGrid->h() - WinInformations->h())/2 + WinGrid->y());
WinInformations->set_modal();
{ Fl_Button *BtExit = new Fl_Button(90, 60, 60, 25);
BtExit->label("Exit");
//BtExit->callback([](Fl_Widget*, void*) {WinInformations->hide();}); // NO WORK
//BtExit->callback([WinInformations](Fl_Widget*, void*) {WinInformations->hide();}); // NO WORK
BtExit->callback([](Fl_Widget*, void *WinInformations) {
Fl_Window *Win = (Fl_Window*)WinInformations;
//Win->hide(); // Segmentation fault
//delete Win; // NO WORK
});
}
WinInformations->show();
//sleep(10); // Does not display the above window with this sleep
//WinInformations->hide();
}