Re: Writing Applications for Mac OS X
- To: mathgroup at smc.vnet.net
- Subject: [mg41101] Re: Writing Applications for Mac OS X
- From: "John Jowett" <John.Jowett at cern.ch>
- Date: Sat, 3 May 2003 03:26:58 -0400 (EDT)
- Organization: CERN
- References: <b8lh5e$9c7$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
(Originally I inadvertently sent this as reply only to the initiator of the thread; I'm reposting it now to the group in case it is useful to others ... JMJ). David, What is not clear is what you mean by "my AddOns\Applications folder". Do you mean the one inside the Mathematica installation folder whose location is stored in the Mathematica symbol $TopDirectory ? On Windows 2000 or XP, this is usually C:\Program Files\Wolfram Research\Mathematica\4.2 and it contains a sub-folder AddOns\Applications. Although your packages will work if you install them there, it is NOT the place for applications developed by users. I.e., there is a good reason why the corresponding folder may be hidden on MAC OS X. If you evaluate $AddOnsDirectory on Windows, you get C:\Documents and Settings\All Users\Application Data\Mathematica which contains a sub-folder Applications which is intended to contain application packages available to all users of the system. Similarly $UserAddOnsDirectory gives C:\Documents and Settings\<username>\Application Data\Mathematica which contains a sub-folder Applications which is intended to contain application packages available to an individual user. This is also clear if you look in the Help Browser/Getting Started/File Layout section or by inspecting the value of $Path. I don't know the detailed folder names on Mac OS X but it should be possible to find them via Mathematica's virtual operating system by evaluating $UserAddOnsDirectory, etc. Aside from the clear logic, this has the advantage that you keep your own stuff completely separated from the stuff that comes from Wolfram's installation CD. So you don't have to worry about moving your settings and packages next time you upgrade versions. (Not quite true before 4.2 ...) The scheme also includes proper places for adding palettes, stylesheets, documentation for the Help Browser (although I would like to know better how to do this myself ...). I have personally found this very useful, e.g., when I wanted to add my own general purpose package ColorListPlot to the Graphics` context, which is where it logically belonged. Without touching the folder where the standard Graphics` packages are installed, I just put it in {$UserAddOnsDirectory,"Applications","Graphics"} and load it with Needs["Graphics`ColorListPlot`"] A user can also cleanly override standard packages with his own versions. I hope this helps, John Jowett "David Park" <djmp at earthlink.net> wrote in message news:b8lh5e$9c7$1 at smc.vnet.net... > I have written an application that involves packages, a style sheet, a > palette, and a sets of notebooks grouped in Chapters. I used the following > file structure, which I put in my AddOns\Applications folder on a Windows > system. > > ComplexAnalysis\ > package1.nb > package1.m > package2.nb > package2.m > Chapter 1\ > notebook1.nb > notebook2.nb > FrontEnd\ > Palettes\ComplexAnalysisPalette.nb > StyleSheets\ComplexAnalysisStyle/nb > > This works find for me. The notebooks have access to the packages and the > style sheet, and the palette is in the Palettes menu. I zipped it all up and > sent it to a friend working with Mac OS 9. It worked fine for him. I also > sent it to another friend who is working with Mac OS X. He said > > "OK, but I don't know how to open the notebook from there. AddOns is > *hidden* in OS X, and ComplexAnalysis doesn't show up in the > Mathematica Index. That's why I'm running it from the extra copy on my > desktop, which is not a problem so far." > > Apparently he can't get at the notebooks. What is the proper method to > assemble an "application" so it can be run on Mac OS X? > > David Park > djmp at earthlink.net > http://home.earthlink.net/~djmp/ >