From f84f5821b0ff7c3d50cae84940cf948e5dbb899c Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 3 Sep 2016 07:45:31 +0000 Subject: [PATCH] Mac OS platform: make the colbrowser demo load its data file from its bundle when started git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11917 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/Makefile | 2 ++ test/colbrowser.cxx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Makefile b/test/Makefile index 5732a35e8..1a97bbceb 100644 --- a/test/Makefile +++ b/test/Makefile @@ -322,6 +322,8 @@ colbrowser$(EXEEXT): colbrowser.o echo Linking $@... $(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ colbrowser.o $(LINKFLTKFORMS) $(LDLIBS) $(OSX_ONLY) ../fltk-config --post $@ + $(OSX_ONLY) mkdir -p colbrowser.app/Contents/Resources + $(OSX_ONLY) cp -f rgb.txt colbrowser.app/Contents/Resources/ color_chooser$(EXEEXT): color_chooser.o diff --git a/test/colbrowser.cxx b/test/colbrowser.cxx index b167d6539..c5989b2d9 100644 --- a/test/colbrowser.cxx +++ b/test/colbrowser.cxx @@ -62,8 +62,8 @@ int main(int argc, char *argv[]) create_form_cl(); -#ifdef USING_XCODE - // Xcode apps do not set the current directory +#ifdef __APPLE__ + // search for rgb.txt within the bundle strcpy(dbname, argv[0]); char *slash = strrchr(dbname, '/'); if (slash)