Visualization Tools User's Guide
Suppose that you want to know how big the transcript window is, in
pixels. You'd like this number to be easy to update.
Unfortunately, it's not an instance variable of the transcript window or
anything else. So, the Snooper allows you to write a block of code and
display its result.
- Open a Snooper by evaluating Transcript snoop.
- Select the self line.
- From Hide select Watch Expression. (Or,
select Watch Expression from the popup menu.)
- A window titled (Code) appears

- In the Show value of: box, complete the text to read
[:x | x textWidget width * x textWidget
height]
- Modify the Call it: field to read widget
area.

- Click on Do It.
- Observe that a new name widget area has appeared, just as if
it were an instance variable. The actual value will vary, depending on
how big your Transcript window actually is.

- Change the size of your Transcript window. Note that the value of
the widget area in the Snooper does not change -- the Snooper
has no way of knowing that it should be updated.
- Double-click any line of the Snooper, or press the Rebuild
button. Note that the value of the widget area is updated to reflect
the current size.
[ Top of Page | Previous Page | Next Page | Table of Contents ]