[previous] [up] [next]     [contents] [index]
Next: drscheme:rep:edit Up: PLT DrScheme: Programming Environment Previous: Libraries

Tools

Tools are designed for major extensions in DrScheme's functionality. To extend DrScheme to extend the appearance or the functionality the DrScheme window (say, to annotate programs in certain ways, or to add buttons on the frame) use a tool. The Static Debugger and the Syntax Checker are implemented as tools.

Libraries are for extensions of DrScheme that only want to add new functions and other values bound in the users namespace. See section [cross-reference] for more information on constructing libraries.

Tools rely heavily on MzScheme's units. See units for information on how to construct units. They also require understanding of libraries and collections

When DrScheme starts up, it looks in the tools subdirectory of the drscheme collection directory to determine which tools are installed. For each subdirectory of the tools directory, it looks for two files: unit.ss and sig.ss. If sig.ss exists it is loaded when all of the signatures of DrScheme are loaded. The file unit.ss is required to exist. It must evaluate to a unit that imports 6 units matching the signatures: wx^ (all of the names in toolbox manual beginning with wx). mred^ (all of the names in the toolbox manual beginning with mred:) mzlib:core^ and mzlib:print-convert^ (defined in the MzLib), drscheme:export^ (defined below), and zodiac:system^ (defined in PLT McMicMac: Parser Manual).

The drscheme:export^ signature contains the parameters defined in the parameters section, and the other classes described in the next subsections.

For example,

(unit/sig ()
  (import [wx : wx^]
          [mred : mred^]
          [mzlib : mzlib:core^]
          [print-convert : mzlib:print-convert^]
          [drscheme : drscheme:export^]
          [zodiac : zodiac:system^])

  (mred:message-box "tool loaded"))

is a simple tool that opens a dialog as drscheme is started up.





PLT