Author: matt
Date: 2011-01-03 16:53:13 -0800 (Mon, 03 Jan 2011)
New Revision: 8176
Log:
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... .

Modified:
   branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
   branches/branch-1.3/test/help.cxx

Modified: branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj
===================================================================
--- branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj       
2011-01-03 20:51:17 UTC (rev 8175)
+++ branches/branch-1.3/ide/Xcode3/FLTK.xcodeproj/project.pbxproj       
2011-01-04 00:53:13 UTC (rev 8176)
@@ -502,6 +502,7 @@
                C96290E61274D100007D3CFE /* OpenGL.framework in Frameworks */ = 
{isa = PBXBuildFile; fileRef = C96290E51274D100007D3CFE /* OpenGL.framework */; 
};
                C96291151274D1FD007D3CFE /* Cocoa.framework in Frameworks */ = 
{isa = PBXBuildFile; fileRef = C9628FFD1274D0B3007D3CFE /* Cocoa.framework */; 
};
                C984AFA812D02A1800D66DAD /* demo.menu in Resources */ = {isa = 
PBXBuildFile; fileRef = C984AFA712D02A1800D66DAD /* demo.menu */; };
+               C99FD8E212D2A2AD002FC776 /* browser.cxx in CopyFiles */ = {isa 
= PBXBuildFile; fileRef = 6D999C03407EAEE9C4D3477A /* browser.cxx */; };
                C9A374AB3AD29E141C659819 /* fltk.framework in CopyFiles */ = 
{isa = PBXBuildFile; fileRef = FEB0F8FE6383384180570D94 /* fltk.framework */; };
                C9C4C91FDA73557BB6B69F3D /* jchuff.c in Sources */ = {isa = 
PBXBuildFile; fileRef = D9DB580DCA05DE487FACA272 /* jchuff.c */; };
                C9D72F10B7A22DD0349ABC68 /* fltk_forms.framework in Frameworks 
*/ = {isa = PBXBuildFile; fileRef = 097D0B476E396B9AAC6FA1E0 /* 
fltk_forms.framework */; };
@@ -3665,6 +3666,16 @@
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               C99FD8E112D2A295002FC776 /* CopyFiles */ = {
+                       isa = PBXCopyFilesBuildPhase;
+                       buildActionMask = 2147483647;
+                       dstPath = "";
+                       dstSubfolderSpec = 7;
+                       files = (
+                               C99FD8E212D2A2AD002FC776 /* browser.cxx in 
CopyFiles */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                C9EDD42D1274B84100ADB21C /* CopyFiles */ = {
                        isa = PBXCopyFilesBuildPhase;
                        buildActionMask = 2147483647;
@@ -6968,6 +6979,7 @@
                                FD1A7D2F7532522CCF2B0FFB /* Sources */,
                                5CEB6CB961822D1167C891C6 /* Frameworks */,
                                B1608C348129813E176E8357 /* CopyFiles */,
+                               C99FD8E112D2A295002FC776 /* CopyFiles */,
                        );
                        buildRules = (
                                982E85D9644C6688DAA59FCA /* PBXBuildRule */,

Modified: branches/branch-1.3/test/help.cxx
===================================================================
--- branches/branch-1.3/test/help.cxx   2011-01-03 20:51:17 UTC (rev 8175)
+++ branches/branch-1.3/test/help.cxx   2011-01-04 00:53:13 UTC (rev 8176)
@@ -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 @@
 
   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();

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to