Adding Fl::hide_all_windows()

This commit is contained in:
Matthias Melcher 2023-01-05 15:20:05 +01:00
parent 9ef9bbe80e
commit 4bff15278e
2 changed files with 12 additions and 0 deletions

View File

@ -453,6 +453,7 @@ public:
\version 1.4.0
*/
static void program_should_quit(int should_i) { program_should_quit_ = should_i; }
static void hide_all_windows();
static Fl_Widget* readqueue();

View File

@ -668,6 +668,17 @@ int Fl::ready()
return system_driver()->ready();
}
/** Hide all visible window to make FLTK leav Fl::run().
Fl:run() will run as long as there are visible windows. Call hide_all_windows()
will hide all windows, effectively terminating the Fl::run() loop.
\see Fl::run()
*/
void Fl::hide_all_windows() {
while (Fl::first_window()) {
Fl::first_window()->hide();
}
}
int Fl::program_should_quit_ = 0;
////////////////////////////////////////////////////////////////