diff options
| author | Greg Ercolano <erco@seriss.com> | 2017-10-30 03:57:33 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2017-10-30 03:57:33 +0000 |
| commit | b1cff66e86566bbed8897b0edb9873b93ccbc08b (patch) | |
| tree | ff77e86df17d502f337d3ed8a82e496e49b22a35 /examples | |
| parent | 78c699caa057a025f241cddcda87b39d8cceacfb (diff) | |
Added check if nanosvg is enabled or not.
The example posts a warning dialog if it's not (vis a vis test/cube demo)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12535 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/howto-simple-svg.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/howto-simple-svg.cxx b/examples/howto-simple-svg.cxx index 28535856c..6b7c6bc11 100644 --- a/examples/howto-simple-svg.cxx +++ b/examples/howto-simple-svg.cxx @@ -16,11 +16,13 @@ // // http://www.fltk.org/str.php // +#include <config.h> /* needed only to detect FLTK_USE_NANOSVG */ #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Box.H> #include <FL/Fl_SVG_Image.H> #include <FL/Fl_Shared_Image.H> +#include <FL/fl_message.H> /* svg logo */ const char *svg_logo = @@ -53,6 +55,10 @@ const char *svg_logo = "</svg>\n"; int main(int argc, char **argv) { +#ifndef FLTK_USE_NANOSVG + fl_message("You need to build fltk with --enable-nanosvg to use this example."); + return(1); +#else Fl_SVG_Image *svg = new Fl_SVG_Image(NULL, (char*)strdup(svg_logo)); // XXX: strdup() shouldn't be needed -- see STR #3421 Fl_Window *win = new Fl_Window(720, 486, "svg test"); Fl_Box *box = new Fl_Box(10,10,720-20,486-20); @@ -60,6 +66,7 @@ int main(int argc, char **argv) { win->end(); win->show(argc,argv); return(Fl::run()); +#endif } // |
