This section describes some of the basic ways in which you can use the Class Browser by giving some examples. If you wish, you can skip this section and look at the descriptions of each individual view: these start with Examining slot information.
When examining a class, the slot names of the class are displayed by default.
To examine a class, follow the instructions below:
(capi:contain
(make-instance 'capi:push-button-panel
:title "Test Buttons"
:items '(:one :two :three)))
The push button panel appears on your screen.
This invokes the Class Browser on the button panel. The class capi:push-button-panel
is described in the Class Browser.
Figure 8.1 Examining classes in the Class Browser
Notice that, although you invoked the browser on an object that is an instance of a class, the class itself is described in the Class Browser. Similarly, if you had pasted the object into an Inspector, the instance of that object would be inspected. Using the environment, it is very easy to pass Common Lisp objects between different tools in this intelligent fashion. This behavior is achieved using the LispWorks IDE clipboard; see Using the Object operations with the clipboard for details.
See Performing operations on selected objects for a full description of the standard action commands available.
A list of the slots in the current class is printed in the Slots area. By selecting any slot, you can examine it in more detail in the Description area.
While still examining the capi:push-button-panel
class, select any slot in the
Slots
area.
Figure 8.2 Description of a slot
A description of the slot is given in the Description area. For details about the information contained in this description, see Description list.
By default, inherited slots (those slots which are defined in a superclass of the current class, rather than the current class itself) are listed in the Slots area along with the slots defined in the current class. Deselect the Include Inherited Slots button just above the Filter box to inhibit this listing.
capi:push-button-panel
class, click
Include Inherited Slots
to deselect this option.
No slots are displayed in the
Slots
area. This is because all the slots available to the capi:push-button-panel
class are inherited from its superclasses. No slots are defined explicitly on the capi:push-button-panel
class.
Notice that the slot description for each slot tells you which superclass the slot is defined on.
The Filter box can be used to filter out information about slots you are not interested in. This is especially useful if you are examining classes which contain a large number of slots.
The example below shows you how to create an instance of a CAPI object, and then limit the display in the Class Browser so that the only slots displayed are those you are interested in:
(capi:contain (make-instance 'capi:list-panel
:items '("Apple" "Orange" "Pear")))
This creates a list panel object and displays it on your screen. The list panel object is the current value in the Listener.
Suppose you are only interested in seeing the callbacks that can be defined in a list panel.
callback
in the Filter box.Figure 8.3 Using filters to limit the display in the Class Browser
You can immediately see the types of callback that are available to CAPI list panel objects. See the CAPI User Guide and Reference Manual for details about these callbacks.
For more information about using filters, see Filtering information.
There are two ways that you can examine other classes. The first is to type the name of the class you wish to see into the
Class
text box at the top of the browser. For long class names, you might find it useful to type just a few characters and then press Up
or Down
to invoke in-place completion. Press Return
or click
and the named class is described.
The class capi:push-button-panel
is described.
Because some class names may be potentially quite long, you can use completion to reduce typing. This allows you to select from a list of all class names which begin with the partial input you have entered. See Completion for detailed instructions. When you have entered the complete class name, click on to make this the class being described.
The second way to examine other classes is by using the Superclasses and Subclasses lists available in the hierarchy view. Click on the Hierarchy tab to display the hierarchy view.
The main part of the hierarchy view consists of two lists:
Double-click on any superclass or subclass of the current class to examine it.
CAPI:BUTTON-PANEL
in the
Superclasses
list.
The capi:button-panel
class is described.
CAPI:PUSH-BUTTON-PANEL
in the
Subclasses
list.So, using the Hierarchy tab, you can easily look through the related classes in a system.
As with many of the other tools in the LispWorks IDE, you can sort the items in any of the lists or graphs of the Class Browser using the Preferences dialog. Raise this dialog as described in Setting preferences, and then select Class Browser in the list on the left side.
Figure 8.4 Setting Class Browser preferences
Under the General tab, there are three options for sorting items, listed in the Sort panel.
For more information on sorting items, see Sorting items in views.
LispWorks IDE User Guide (Macintosh version) - 13 Sep 2017