diff options
| author | wcout <wcout@users.noreply.github.com> | 2023-01-21 17:27:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-21 17:27:58 +0100 |
| commit | 2ddfd9d9492d9fc1df111ec9211dd1be4d424c35 (patch) | |
| tree | c766d0dfb3a2d7a75c275db2821d5bcf0e935a15 /test/help_dialog.cxx | |
| parent | 1fc269b0d4c79b256cc57740d318f95dded8c340 (diff) | |
Animated GIF support (Fl_Anim_GIF_Image class) (#375)
Diffstat (limited to 'test/help_dialog.cxx')
| -rw-r--r-- | test/help_dialog.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/help_dialog.cxx b/test/help_dialog.cxx index 5970792bb..e87c5e922 100644 --- a/test/help_dialog.cxx +++ b/test/help_dialog.cxx @@ -24,9 +24,18 @@ // #include <FL/Fl_Help_Dialog.H> +#include <FL/Fl_GIF_Image.H> #include <FL/filename.H> /* FL_PATH_MAX */ +#include <FL/Fl.H> /* Fl::first_window(), etc */ #include <string.h> /* strcpy(), etc */ +static void cb_refresh(void *d) { + // trigger a redraw of the window to see animated GIF's + if (Fl::first_window()) + Fl::first_window()->redraw(); + Fl::repeat_timeout(1./10, cb_refresh, d); +} + // // 'main()' - Display the help GUI... // @@ -35,6 +44,7 @@ int // O - Exit status main(int argc, // I - Number of command-line arguments char *argv[]) // I - Command-line arguments { + Fl_GIF_Image::animate = true; // create animated shared .GIF images Fl_Help_Dialog *help = new Fl_Help_Dialog; int i; if (!Fl::args(argc, argv, i)) Fl::fatal(Fl::help); @@ -44,6 +54,7 @@ main(int argc, // I - Number of command-line arguments help->show(1, argv); + Fl::add_timeout(1./10, cb_refresh, help); // to animate GIF's Fl::run(); delete help; |
