RE: RE: RE: Installing package "SpreadOption`"
- To: mathgroup at smc.vnet.net
- Subject: [mg35945] RE: [mg35826] RE: [mg35699] RE: [mg35673] Installing package "SpreadOption`"
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 9 Aug 2002 05:17:53 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
So, wouldn't it be a good idea if WRI automatically included FrontEnd`FileName[{$TopDirectory, "AddOns", "ExtraPackages", _, "FrontEnd", "Palettes"}, CharacterEncoding -> "WindowsANSI"] on the PalettePath and FrontEnd`FileName[{$TopDirectory, "AddOns", "ExtraPackages", _, "FrontEnd", "StyleSheets"}, CharacterEncoding -> "WindowsANSI"] on the StyleSheetsPath? Then complete packages could just be dropped into the ExtraPackages folder, where they would more logically belong, instead of putting them in the Applications folder. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Omega Consulting [mailto:omega_consulting at yahoo.com] To: mathgroup at smc.vnet.net All of these are possible. Mathematica has a drop-in system as long as you understand the layout scheme (which is a bit complicated, but worth understanding). The trick is that each package gets its own directory. Avoiding the conflicts you describe above. All these properties are set by options, so let's look at an option: In[3]:= pp=PalettePath/.Options[$FrontEnd, PalettePath]; Let's just look at one value, the others are similar. In[5]:= pp[[6]] Out[5]= FrontEnd`FileName[{$TopDirectory,AddOns,Applications,_,FrontEnd,Palettes}, CharacterEncoding\[Rule]WindowsANSI] This says look in $TopDirectory/AddOns/Applications for directories of any name. Then in those directories look for a FrontEnd/Palettes directory with *.nb files. If any of these files exist, when the front end is started, then it will be included in the Palettes menu. Similar things are done for StyleSheetPath and AddOnHelpPath (for documentation). There are also other more exotic paths like ConfigurationPath and SpellingDictionariesPath, but these are largely unused. So when I write a package it looks like this: MyPackageName/ MyPackages.m (Actual packages) Kernel/ init.m (Stub package. Loaded by <<MyPackageName`) FrontEnd/ Palettes/ MyPalettes.nb (Palettes) StyleSheets/ MyStyleSheets.nb (Stylesheets) Documentation/ $Language/ (English, French, Japanese, etc.) BrowserCategories.m (Organization of docs) BrowserIndex.nb (Master Index entries) HelpFiles.nb (Actual documentation) Just drop the whole tree into the $TopDirectory/AddOns/Applications directory (a couple other directories work as well) and you're ready to go. (Except you have rebuild the help index, but otherwise you're set.) -------------------------------------------------------------- Omega Consulting "The final answer to your Mathematica needs" Spend less time searching and more time finding. http://www.wz.com/internet/Mathematica.html