mirror of
https://github.com/fltk/fltk.git
synced 2026-06-01 14:52:46 +08:00
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:
+6
-28
@@ -26,26 +26,6 @@
|
|||||||
|
|
||||||
#include <FL/Fl_Help_Dialog.H>
|
#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...
|
// 'main()' - Display the help GUI...
|
||||||
//
|
//
|
||||||
@@ -63,14 +43,12 @@ main(int argc, // I - Number of command-line arguments
|
|||||||
|
|
||||||
#ifdef USING_XCODE
|
#ifdef USING_XCODE
|
||||||
|
|
||||||
if (argc>argn && strncmp(argv[1], "-psn_", 5)==0) argn++;
|
char buf[2048];
|
||||||
else if (argc>argn && strncmp(argv[1], "-NSDocumentRevisionsDebugMode", 29)==0) argn += 2;
|
strcpy(buf, argv[0]);
|
||||||
set_app_dir();
|
char *slash = strrchr(buf, '/');
|
||||||
|
if (slash)
|
||||||
if (argc <= argn)
|
strcpy(slash, "/../Resources/help-test.html");
|
||||||
help->load("../../../../test/help-test.html");
|
help->load(buf);
|
||||||
else
|
|
||||||
help->load(argv[argn]);
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user