summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-06-30 15:28:35 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-06-30 15:28:35 +0200
commit3b249de60a99e639704ce8dba77e593c7c07aec1 (patch)
treee22358d34fece3fabafae0c7427aa720374f11af
parent8d4b0c15f795ec431983f4b04357417e6c8dba77 (diff)
Clarify documentation (STR 3532)
Make clear that Fl::repeat_timeout() must only be called for the same timeout it is handling. Related STR's: https://www.fltk.org/str.php?L3532 https://www.fltk.org/str.php?L3516
-rw-r--r--FL/Fl.H29
1 files changed, 16 insertions, 13 deletions
diff --git a/FL/Fl.H b/FL/Fl.H
index 405eba47b..3c4a0f011 100644
--- a/FL/Fl.H
+++ b/FL/Fl.H
@@ -473,22 +473,25 @@ int main() {
static void add_timeout(double t, Fl_Timeout_Handler,void* = 0); // platform dependent
/**
Repeats a timeout callback from the expiration of the
- previous timeout, allowing for more accurate timing. You may only call
- this method inside a timeout callback.
-
+ previous timeout, allowing for more accurate timing.
+
+ You may only call this method inside a timeout callback of the same timer
+ or at least a closely related timer, otherwise the timing accuracy can't
+ be improved and the behavior is undefined.
+
The following code will print "TICK" each second on
stdout with a fair degree of accuracy:
-
+
\code
- void callback(void*) {
- puts("TICK");
- Fl::repeat_timeout(1.0, callback);
- }
-
- int main() {
- Fl::add_timeout(1.0, callback);
- return Fl::run();
- }
+ void callback(void*) {
+ puts("TICK");
+ Fl::repeat_timeout(1.0, callback);
+ }
+
+ int main() {
+ Fl::add_timeout(1.0, callback);
+ return Fl::run();
+ }
\endcode
*/
static void repeat_timeout(double t, Fl_Timeout_Handler, void* = 0); // platform dependent