From 01e5f26f2f6c78c3ca62f4c5481065c752f6dafe Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Mon, 25 Jan 2016 18:41:59 +0000 Subject: [PATCH] Fixed incomplete example. Re: David Allen's post today on fltk.general git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11052 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl.H | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/FL/Fl.H b/FL/Fl.H index 674873637..7dfc5ef11 100644 --- a/FL/Fl.H +++ b/FL/Fl.H @@ -389,15 +389,19 @@ public: 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(); - } +#include +#include +#include +void callback(void*) { + printf("TICK\n"); + Fl::repeat_timeout(1.0, callback); // retrigger timeout +} +int main() { + Fl_Window win(100,100); + win.show(); + Fl::add_timeout(1.0, callback); // set up first timeout + return Fl::run(); +} \endcode */ static void add_timeout(double t, Fl_Timeout_Handler,void* = 0); // platform dependent