summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-01-05 15:20:05 +0100
committerMatthias Melcher <github@matthiasm.com>2023-01-05 15:20:13 +0100
commit4bff15278e83616e4da6be9d36ed05c0c949545b (patch)
tree7a58dc2fa1020dcb293728745985ddee70c2327b /src/Fl.cxx
parent9ef9bbe80ed20cbcb05f58327ca4f61297c7899f (diff)
Adding Fl::hide_all_windows()
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index e7ba9f04d..53fb7fff1 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -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;
////////////////////////////////////////////////////////////////