mirror of
https://github.com/fltk/fltk.git
synced 2026-06-07 00:55:23 +08:00
test/help now finds some documentation. This kind of works, but since we decided to load a sample page instead, I will have to improve this... .
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8176 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+39
-3
@@ -36,6 +36,25 @@
|
||||
#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...
|
||||
//
|
||||
@@ -49,11 +68,28 @@ main(int argc, // I - Number of command-line arguments
|
||||
|
||||
help = new Fl_Help_Dialog;
|
||||
|
||||
if (argc < 2)
|
||||
help->load("../documentation/html/main.html");
|
||||
int argn = 1;
|
||||
|
||||
#ifdef USING_XCODE
|
||||
|
||||
if (argc>argn && strncmp(argv[1], "-psn_", 5)==0)
|
||||
argn++;
|
||||
set_app_dir();
|
||||
|
||||
if (argc <= argn)
|
||||
help->load("../../../../documentation/html/intro.html");
|
||||
else
|
||||
help->load(argv[argn]);
|
||||
|
||||
#else
|
||||
|
||||
if (argc <= argn)
|
||||
help->load("../documentation/html/intro.html");
|
||||
else
|
||||
help->load(argv[1]);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
help->show(1, argv);
|
||||
|
||||
Fl::run();
|
||||
|
||||
Reference in New Issue
Block a user