Author: manolo Date: 2012-12-10 04:49:59 -0800 (Mon, 10 Dec 2012) New Revision: 9747 Log: Demo now runs Mac OS test applications both if they are bundled or unbundled.
Modified: branches/branch-1.3/test/demo.cxx Modified: branches/branch-1.3/test/demo.cxx =================================================================== --- branches/branch-1.3/test/demo.cxx 2012-12-09 19:18:53 UTC (rev 9746) +++ branches/branch-1.3/test/demo.cxx 2012-12-10 12:49:59 UTC (rev 9747) @@ -296,6 +296,11 @@ } } + char *name = new char[strlen(cmd) + 5]; + strcpy(name, cmd); + strcat(name, ".app"); + // check whether app bundle exists + if ( ! fl_filename_isdir(name) ) strcpy(name, cmd); if (arg) { const char *fluidpath; *arg = 0; @@ -305,15 +310,18 @@ #else strcpy(path, app_path); strcat(path, "/"); fluidpath = "../fluid/fluid.app"; + // check whether fluid bundle exists + if ( ! fl_filename_isdir(fluidpath) ) fluidpath = "../fluid"; #endif if (strcmp(cmd, "../fluid/fluid")==0) { sprintf(command, "open %s --args %s%s", fluidpath, path, arg+1); } else { - sprintf(command, "open %s.app --args %s%s", cmd, path, arg+1); + sprintf(command, "open %s --args %s%s", name, path, arg+1); } } else { - sprintf(command, "open %s.app", cmd); + sprintf(command, "open %s", name); } + delete[] name; // puts(command); system(command); _______________________________________________ fltk-commit mailing list fltk-commit@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-commit