next up previous contents
Next: the complex plane in Up: Program appearance Previous: text windows

browsers

Browsers are another aspect of the operating system which can be incorporated in application programs at the programmer's desire; the procedure is much the same as for coupling text fields to files; namely to copy a browser which is already working, or to look it up in a textbook. The new browser program has to supply the text (or even icons) that the browser will display, which is accomplished by delegation. A delegate can be associated with an object by mouse dragging in the interface builder, or set up through programming.


  
Figure 4: The REC/C main window, which contains the REC directory, a program definition area, and a viewer for the resulting construction.
\begin{figure}
\centering
\begin{picture}
(406,225)
\put(0,0){\epsfxsize=406pt \epsffile{recin.eps}}
\end{picture}
\end{figure}

A delegate is expected to provide methods which could have been incorporated in the delegating program, but for some reason, weren't. The principal reason is that there was no way of forseeing, when the master program was written, exactly what the methods were supposed to do. After all, each application will have its own items to display, and its own reactions to their selection; such information is best incorporated in the application program itself.

Looking around the REC/C main window, two other text fields can be seen. One, which is alwas present, is used for holding error messages and comments, such as displaying the definition of REC operators. Although there is no requirement within the language to do so, it is customary to use single letters (or ASCII characters) for the operators because of their convenience and ease of remembering. Of course, such a principle only works when there are enough letters to go around, which is one of the reason for tailoring individual REC programs instead of concocting a universal or general purpose REC.

The other text field accompanies the browser to hold REC programs after their selection by a double mouse click. They can be edited, and executed by a carriage return, but the field is not connected to the filing mechanism. Nevertheless, copying and pasting between the big text panel and the browser line is always possible, so the text field in the browser is not completely isolated.

The browser in the main window of REC/C is stocked with information of various types. The first item copies the header file which identifies the operators and predicates in REC/C, a variant of which has to be included in all REC programs. It supplements the button panel for REC definitions, because it is easier to scan a list of possibilities than to press the buttons one by one. On the other hand, for quick recollection or to identify an unfamiliar letter in a displayed program, the buttons are handier.

The remaining items carry either the coordinates of some frequently used basic polygons or instructions for developing particular strips. Since the counter only admits constants as its argument, some editing may be required to adapt a generic ``!n!'' to the given polygon.

In the first case, a double click on the selected polygon will set up the coordinates, in the second, the double click will move the REC program to the nearby text field for editing and execution.


next up previous contents
Next: the complex plane in Up: Program appearance Previous: text windows
Microcomputadoras
2001-02-12