Page Numbers: Yes X: 522 Y: 10.5"
Columns: 1 Edge Margin: 1" Between Columns: .5"
Heading: Not-on-first-page
ProfileTool
ProfileTool
Documentation:[Phylum]<LispUsers>ProfileTool.Press
Program:
{Phylum}<LispUsers>ProfileTool.Dcom
Revised:
July 18, 1983 by Martin Yonke

General comments
The ProfileTool is used to create a graphical user interface to attributes of any "package" written in Interlisp. It accomplishes this by creating a specialized InspectorWindow for enumerating and changing variables, etc. of a package as described to the ProfileTool. [It assumes the user is familiar with the use of InspectorWindows.]
Use
A ProfileTool is created by calling the function PROFILETOOL with ProfileKeys and a title for the InspectorWindow. ProfileKeys is a list of instances of the record PROFILEKEY. A PROFILEKEY record has the following fields: DESCRIPTOR, FETCHFN, REPLACEFN, HELPSTRING, and EXTRADATA.
DESCRIPTOR is usually an atom (although it can be a string) which gets printed as the "property name" in the InspectorWindow.
FETCHFN is a function to be envoked to determine the "value" of the DESCRIPTOR. If FETCHFN is a litatom, then it will be applied (APPLY*) to the DESCRIPTOR and PROFILEKEYS. If FETCHFN is NIL, then (GETTOPVAL DESCRIPTOR) will be used.
REPLACEFN is a function to be envoked to "set" the value of the DESCRIPTOR. If REPLACEFN is a litatom, then it will be applied to DESCRIPTOR and PROFILEKEYS (unless it is the atom DON’T, in which case there is no REPLACEFN). It should determine a value, usually by asking the user, and return the new value. If REPLACEFN is a list of litatoms, then that list will be taken as the list of all possible values for the DESCRIPTOR, a pop-up menu will be created of those items, and a SETTOPVAL will be envoked on the DESCRIPTOR and the value returned from MENU. If REPLACEFN is NIL, then the behavior will be as if REPLACEFN was (T NIL) – i.e. the only possible values of DESCRIPTOR are T or NIL. Whenever REPLACEFN is used, the new value will be redisplayed in the ProfileTool window, expanding it’s width if necessary.
HELPSTRING is a string to be printed out in the PROMPTWINDOW under certain conditions. [Currently, HELPSTRING is not used since the conditions have not yet been determined, but is planned to be used in the future.]
EXTRADATA is a place holder for any "package information" associated with the DESCRIPTOR. Since PROFILEKEYS are passed to FETCHFN and REPLACEFN, a user of ProlfileTool can use this as he pleases (e.g. to cache information).
Some Examples
If a package has a global variable that should only have the values T or NIL, then the key in PROFILEKEYS can be just the value of (create PROFILEKEY DESCRIPTOR ← ’var).
If a package has a global variable that should only have the values FOO, FUM, or FIE, then the key should be the value of
(create PROFILEKEYDESCRITOR ← ’var
REPLACEFN ← ’(FOO FUM FIE)).
If a package wants to display a read-only item, e.g. the user’s name, then the key should be the value of
(create PROFILEKEYDESCRIPTOR ← ’UserName
FETCHFN ← (FUNCTION GETUSERNAME)
REPLACEFN ← ’DON’T)
where
GETUSERNAME is defined to be (LAMBDA (D K) (USERNAME NIL T)).
Of course, the FETCHFN and REPLACEFN can be as complex as necessary. ProfileTool has been designed to give maximum flexiblity, but simplifying the most typical cases – i.e. global variables with a fixed set of possible values.