Visualization Tools User's Guide


Watch Expressions

The Snooper allows you to attach a watch expression to an object; the expression's value will be displayed on its own line, indented beneath the object's line, just as if the expression were an attribute of the object.

  1. Select the line of the table that the expression will be evaluated upon.
  2. From Hide select Watch Expression. (Or, select Watch Expression from the popup menu.)

    A (Code) window appears.

  3. (Optional) Check that you are attaching the block to the right object, by looking at the line on the window displaying its value, and the line beneath it displaying its type.
  4. Fill in the text block labelled Show value of: with the text of a one-argument Smalltalk block, computing the desired value. The text block is initialized with the start of a one-argument block.
  5. (Optional) Type a name that the block will appear under. The name is initially block. Hint: Starting the name with a tilde () will keep it from looking like an instance variable.
  6. (Optional) Make your block more resistant to updates of the underlying object by specifying the class that the method should be applied to, and leaving Only evaluate on specimens of that class selected.

    Or, make your block more flexible by deselecting Only evaluate on specimens of that class. This will evaluate the block on values of all classes (e.g., if you have attached the block to an instance variable, and change the value of that variable to one of another class).


[ Top of Page | Previous Page | Next Page | Table of Contents ]