Last updated at 5:48 am UTC on 19 July 2018
The Inspector is an essential Smalltalk tool. It is used to inspect the contents (instance variables) of a live object. You can also use it to send messages to an object.
To open an inspector, highlight an object or snippet of Smalltalk code in a Workspace or other text window, and select "inspect it" from the pop-up menu. (or use alt-i)
For example, open a Workspace and type 3@4 into it, then highlight this text and "inspect it".
This will open an inspector window on the object, with the object's instance variables in a column on the top-left, a variable display area on the top-right, and a code area on the bottom. In this code area, you can send messages to the object, by entering something like self printString or self printString asSortedCollection and then alt-p or alt-i.
An object with an open Inspector will not be garbage collected.](Note that the "chase pointers" feature [of the Inspector] can be misleading as it is assumed that for this feature you are interested in "all but" the reference paths starting from the inspector you hold).
If you evaluate
in the code pane of the Inspector object you get a Browser showing the code of the class of the object.
In recent version of Squeak you may drag out a field from the list in the inspector and drop it into a Workspace to get a reference to it there.
The Object Explorer is a hierarchical alternative to the traditional Inspector which has been available since 1980.