Pnutool is a GUI version of the Pnuts script interpreter, which is written entirely in the Pnuts script language. Since the script language can call any public member of a Java class, a User can try any public call to see what happens using this tool.
It can be either an applet or an application. The applet version has some restrictions for security reasons, as is usual for applets, unless the applet is digitally signed.
C:\> pnutool |
Pnutool has two TextAreas, a workspace area and an output area. The workspace area is where the User gives commands. The output of the execution is printed in output area.
In the File menu, Open, Load, and Save are available only for the application version. Open opens a local file and displays in the workspace area. Open URL reads from specified URL and displays in the workspace area. Save saves the contents of the workspace area into the specified local file. Load loads a script from the local file system.
Eval sends the User's input to interpreter. If some text in the workspace is selected, the selected text is sent as a command. If no text is selected the current line is sent as a command.
For example, input the following commands into the workspace and select all of the commands. Perform an evaluation, Eval(or type Ctrl-j).
import("java.awt.*") frame = Frame("test") frame.setSize(100, 100) frame.show()
A Frame object will be created and displayed as the result. Then to change the size of the window, edit the 2nd command as 'frame.setSize(200, 200)' and select the command text by dragging the mouse cursor. Select the Eval item again. The window will become twice as large as before.