Simplify test/help.cxx when USING_XCODE is set.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11736 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy
2016-05-15 08:28:47 +00:00
parent 90e4ba1eed
commit cc3ef5bec9
+6 -28
View File
@@ -26,26 +26,6 @@
#include <FL/Fl_Help_Dialog.H>
#ifdef USING_XCODE
#include <ApplicationServices/ApplicationServices.h>
void set_app_dir() {
char app_path[2048];
CFBundleRef app = CFBundleGetMainBundle();
CFURLRef url = CFBundleCopyBundleURL(app);
CFStringRef cc_app_path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
CFStringGetCString(cc_app_path, app_path, 2048, kCFStringEncodingUTF8);
if (*app_path) {
char *n = strrchr(app_path, '/');
if (n) {
*n = 0;
chdir(app_path);
}
}
}
#endif
//
// 'main()' - Display the help GUI...
//
@@ -63,14 +43,12 @@ main(int argc, // I - Number of command-line arguments
#ifdef USING_XCODE
if (argc>argn && strncmp(argv[1], "-psn_", 5)==0) argn++;
else if (argc>argn && strncmp(argv[1], "-NSDocumentRevisionsDebugMode", 29)==0) argn += 2;
set_app_dir();
if (argc <= argn)
help->load("../../../../test/help-test.html");
else
help->load(argv[argn]);
char buf[2048];
strcpy(buf, argv[0]);
char *slash = strrchr(buf, '/');
if (slash)
strcpy(slash, "/../Resources/help-test.html");
help->load(buf);
#else