summaryrefslogtreecommitdiff
path: root/test/demo.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2012-12-10 12:49:59 +0000
committerManolo Gouy <Manolo>2012-12-10 12:49:59 +0000
commitd9666eb8c971affe9428524408b31e3501d4c76e (patch)
tree9e1df64f766ee6bbcec168a50cd5ffc2fa1a34a0 /test/demo.cxx
parent582d8ed34caf98b415618c83f23d361cf60d72ac (diff)
Demo now runs Mac OS test applications both if they are bundled or unbundled.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9747 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/demo.cxx')
-rw-r--r--test/demo.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/demo.cxx b/test/demo.cxx
index f15167bbf..a4366c37c 100644
--- a/test/demo.cxx
+++ b/test/demo.cxx
@@ -296,6 +296,11 @@ void dobut(Fl_Widget *, long arg)
}
}
+ 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 @@ void dobut(Fl_Widget *, long arg)
#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);