diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2025-05-13 21:04:56 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2025-05-13 21:08:51 +0200 |
| commit | 9b1379e6888abc7cc051a6c82d8b27ce454ceb5a (patch) | |
| tree | e3256c9936097166efac395a2411eba4e8da5f34 /src/Fl.cxx | |
| parent | 4d0c1a2a289556eacc63fd407fb77d8190be0b1f (diff) | |
Remove deprecated function Fl::set_idle()
This turned out to be more complicated than just to delete a function
because it was used internally, and the callback signatures were a bit
flaky. I also added a lot of documentation to clarify matters.
FL/Fl.H: document idle callback signatures, make some internal
functions of class Fl private, add public Fl::idle() accessor (read-
only), add Fl::add_idle(Fl_Old_Idle_Handler cb) to enable using
old-style idle callbacks w/o 'data' argument.
FL/forms.H: replace Fl::set_idle() with Fl::add_idle().
src/Fl.cxx: rename private Fl::idle_ with trailing underscore.
src/Fl_System_Driver.cxx: use new public accessor Fl::idle() to access
Fl::idle_ which is now private.
src/Fl_add_idle.cxx: improve documentation, clarify idle callback
matching, add example code in docs, rename methods, add overloaded
Fl::add_idle(Fl_Old_Idle_Handler cb).
src/Fl_win32.cxx: use public Fl::idle() rather than private member.
src/drivers/Unix/Fl_Unix_System_Driver.cxx: same as above.
src/Fl_cocoa.mm: same as above.
Diffstat (limited to 'src/Fl.cxx')
| -rw-r--r-- | src/Fl.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index bae7f1328..b1c38caf6 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -580,7 +580,7 @@ void fl_trigger_clipboard_notify(int source) { //////////////////////////////////////////////////////////////// // idle/wait/run/check/ready: -void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions +void (*Fl::idle_)(); // see Fl::add_idle.cxx for the add/remove functions /* Private, undocumented method to run idle callbacks. @@ -611,9 +611,9 @@ void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions */ void Fl::run_idle() { static char in_idle; - if (Fl::idle && !in_idle) { + if (Fl::idle_ && !in_idle) { in_idle = 1; - Fl::idle(); + Fl::idle_(); // call the idle callback stored in Fl::idle_ == Fl::idle() in_idle = 0; } } |
