LispWorks IDE User Guide > 2 A Short Tutorial

NextPrevUpTopContentsIndex

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 tool 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.
  2. (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 Example CAPI window. Pressing any of these buttons prints the value of the button pressed.

    Figure 2.4 Example CAPI window

  3. Click on the Output tab in the Listener.
  4. Try clicking on any of the buttons in the window you just created, and look at the output generated.
  5. Now try a second example by entering the form below into the Listener at the current prompt (remember to click the Listener tab in the Listener first).
  6. (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.

  7. Type the word hello into the text input pane and press Return . Look at the generated output in the output view.

LispWorks IDE User Guide (Macintosh version) - 22 Dec 2009

NextPrevUpTopContentsIndex