From c98f143ccbe6bd9108bd4d254716acbb6ef80f6d Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 3 Sep 2016 07:35:59 +0000 Subject: [PATCH] Mac OS platform: make the help demo load its data file when started after configure build. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11916 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/Makefile | 2 ++ test/help.cxx | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/Makefile b/test/Makefile index 0351a9aa1..5732a35e8 100644 --- a/test/Makefile +++ b/test/Makefile @@ -367,6 +367,8 @@ help$(EXEEXT): help.o $(IMGLIBNAME) echo Linking $@... $(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) help.o -o $@ $(LINKFLTKIMG) $(LDLIBS) $(OSX_ONLY) ../fltk-config --post $@ + $(OSX_ONLY) mkdir -p help.app/Contents/Resources + $(OSX_ONLY) cp -f help-test.html help.app/Contents/Resources/ icon$(EXEEXT): icon.o diff --git a/test/help.cxx b/test/help.cxx index 6bf8ddc77..f5c51d69d 100644 --- a/test/help.cxx +++ b/test/help.cxx @@ -39,10 +39,9 @@ main(int argc, // I - Number of command-line arguments help = new Fl_Help_Dialog; - int argn = 1; - -#ifdef USING_XCODE +#ifdef __APPLE__ + char buf[2048]; strcpy(buf, argv[0]); char *slash = strrchr(buf, '/'); @@ -52,7 +51,7 @@ main(int argc, // I - Number of command-line arguments #else - if (argc <= argn) + if (argc <= 1) help->load("help-test.html"); else help->load(argv[1]);