2 A Short Tutorial

2.5 Inspecting objects using the inspector

The variables*,**, and*** can be used to hold the results of expressions which have been evaluated in the listener.* always holds the result of the last expression evaluated;** holds the previous value of*, and*** hold the previous value of**. These variables (* in particular) are not only useful in their own right; the environment uses them to pass values between different tools.

1. In the listener, type*.

If you have followed this tutorial so far, the text input pane object that you created above is returned. This is because the contain function returns the object that is being contained. You can easily inspect this object more closely in the inspector tool.

2. Choose Values > Inspect from the menu bar of the listener.

This creates an inspector tool which displays the object currently contained in*, as shown in Figure 2.5.

Figure 2.5 Examining a text input pane in the inspector

To keep the size of a given Lisp image small, many parts of the environment are loaded only when they are requested, rather than when the environment is started -- this behavior is known as load-on-demand. The inspector is loaded on demand, so you may notice a slight delay after you choose the menu command before the tool appears.

The commands in the Values menu always act upon the current value of*. This enables you to pass a value easily from any tool to any other. Similar menus can be found in all tools in the environment, and the behavior of each command is consistent throughout the environment. For a full description of the functionality of these menus, see Section 3.8 on page 43.

The main part of the inspector is a list of all the slots available in the object being inspected. This list shows both the name of each slot and its current value. Above this list is an area called the Filter area. This lets you filter the information shown in the main list, which can be useful when you are inspecting objects with a large number of slots. The name of the object being inspected appears immediately below the menu bar.

3. Move the focus to the filter area, type the wordtext and then press Return.

This restricts the display in the inspector to only those items which contain the string "text", either in the slot name or in the slot value.

After using the filter, you can easily see that one of the available slots contains the text that you typed into the text input pane.

The inspector always displays the actual instantiation of a given object (as opposed to a copy of it), so that you can be certain that any changes to the object itself are reflected in the inspector.

4. Display the text input pane that you created earlier.

If you can no longer see it, choose Works > Windows > My Text Input Pane from any window; this is a simple way to display any of the windows and tools that you have created so far.

5. Move the focus into the text input pane and press the Backspace key until the wordhello has been deleted. Typegoodbye and press Return.

6. Go back to the inspector and choose Works > Update.

The description of the text slot now reflects the new value you specified.

7. Close the inspector by choosing Works > Exit > Window from its menu bar.

You can close any window in the environment in this way, although your window manager may also provide you with alternative ways of closing windows.

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

Generated with Harlequin WebMaker