2 A Short Tutorial

2.4 Viewing output

There are many different ways to view output generated by the environment. In many tools, for example, output appears as soon as it is generated -- this happens, for instance, when you compile code in the built-in editor.

At other times, you can view output in a tool called the output browser. This tools collects together all the output generated by the environment, and is particularly useful for viewing output generated by your own processes (which cannot be displayed in any other environment tool). The output browser displays all the output sent to the default value of the variable*standard-output*.

1. Evaluate the following in the listener.

(capi:contain 
 (make-instance 'capi:push-button-panel 
                :items '(:red :yellow :blue) 
                :selection-callback 
                #'(lambda (data interface) 
                    (format t 
                       "Pressed button in interface ~S~% data=~S~%"
                       interface data))))

This is a piece of CAPI code that creates a window with three buttons, labeled RED, YELLOW and BLUE, as shown in Figure 2.4. Pressing any of these buttons returns the value of the button pressed.

Figure 2.4 Example CAPI window

2. Choose Tools > Output Browser from the podium window to create an output browser.

3. Try clicking on any of the buttons in the window you just created, and look at the output generated in the output browser.

4. Now try a second example by typing the form below into the listener.

(capi:contain (make-instance
                'capi:text-input-pane
                :callback #'(lambda (text interface)
                              (format t 
                                      "You entered: ~S~%" text)))
              :title "My Text Input Pane")

The object that this code creates is going to demonstrate the inspector tool. The code above creates a window containing a text input pane. You can type text directly into a text input pane, and this can be passed, for instance, to other functions for further processing.

5. Type the wordhello into the text input pane and press Return. Look at the generated output in the output browser.


Common LispWorks User Guide, Liquid Common Lisp Version 5.0 - 18 OCT 1996

Generated with Harlequin WebMaker