diff options
| author | Albrecht Schlosser <fltk@aljus.de> | 2024-06-21 17:35:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-21 17:35:01 +0200 |
| commit | 456d53c403c478dd7a5eaf08abead6a7ac2808a0 (patch) | |
| tree | c5a34bce6f19cbf463a50d2c7dbafcad175759ba /src/Fl_Timeout.h | |
| parent | 5ee1c0c9df6fd88e420857a0fbf0165e530413d7 (diff) | |
Add Fl::remove_next_timeout(...) to remove only one timeout (#992)
This method also returns the data pointer of the removed timeout.
This new method is generally useful for user code and particularly
necessary to fix issue #991.
Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
Diffstat (limited to 'src/Fl_Timeout.h')
| -rw-r--r-- | src/Fl_Timeout.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Fl_Timeout.h b/src/Fl_Timeout.h index f6a54a7a6..9d9cc2337 100644 --- a/src/Fl_Timeout.h +++ b/src/Fl_Timeout.h @@ -2,7 +2,7 @@ // Header for timeout support functions for the Fast Light Tool Kit (FLTK). // // Author: Albrecht Schlosser -// Copyright 2021-2022 by Bill Spitzak and others. +// Copyright 2021-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -31,6 +31,7 @@ - Fl::repeat_timeout() - Fl::has_timeout() - Fl::remove_timeout() + - Fl::remove_next_timeout() and related methods of class Fl_Timeout. */ @@ -49,6 +50,7 @@ - Fl::repeat_timeout(double time, Fl_Timeout_Handler cb, void *data) - Fl::has_timeout(Fl_Timeout_Handler cb, void *data) - Fl::remove_timeout(Fl_Timeout_Handler cb, void *data) + - Fl::remove_next_timeout(Fl_Timeout_Handler cb, void *data, void **data_return) */ class Fl_Timeout { @@ -106,6 +108,7 @@ public: static void add_timeout(double time, Fl_Timeout_Handler cb, void *data); static void repeat_timeout(double time, Fl_Timeout_Handler cb, void *data); static void remove_timeout(Fl_Timeout_Handler cb, void *data); + static int remove_next_timeout(Fl_Timeout_Handler cb, void *data = NULL, void **data_return = NULL); // Elapse timeouts, i.e. calculate new delay time of all timers. // This does not call the timer callbacks. |
