[Cuis-dev] question about changing instance variables in an Inspect window

Mark Volkmann r.mark.volkmann at gmail.com
Sat Jun 29 16:44:39 PDT 2024


Can someone explain what's going on near the end of this sequence of basic
steps?

- Open the World menu and select "New Morph...".
- Select "Basic...Boxed Morph" or really any morph with a background fill
color.
  An orange rectangle will appear, attached to the mouse cursor.
- Move to where you want to place it and click to drop it.
- cmd-click (macOS) on the morph to open its halo.
- Click the blue button on the top row.
- Select "debug...inspect morph" to open an Inspect window
   for the object that represents that morph.
- Click the `color` instance variable and note that the value is a `Color`
object.
- Click in the bottom pane.
- Enter `color := Color red` and "Do it".
- Note that the value of the instance variable in the upper-right pane
updates to `Color red`,
  BUT the fill color of the morph does not change.
- Enter `self color: Color blue` and "Do it".
- Note that the value of the instance variable in the upper-right pane
updates to `Color blue`,
  AND the fill color of the morph changes to blue.

Why does the first approach not update the morph, but the second approach
does?
Both update the value of the instance variable inside the Inspect window.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240629/2ffc67f0/attachment.htm>


More information about the Cuis-dev mailing list