dan at gui.com
Tue Nov 17 16:40:01 UTC 1998
scottw at wdi.disney.com wrote:
> At 12:00 AM -0800 11/9/98, Ryan Davis <zss at ZenSpider.com> wrote:
> >3) Is there a registry of known players in a given morph? (possibly a
> >shorter version of #1).
> Yes, but it's maintained under the covers. When you construct scripts for a given Player, every other Player that is referenced by the those scripts is kept track of; that's what the refPlayerxxx things are about.
> You can also define your own instance variables, of type "player", which hold on to references to specific other objects, and you can set their values by direct manipulation if desired. If it's not obvious how to do all of this, please holler.
I have a PasteUpMorph which has within it some buttons (RectangleMorphs
with embedded and locked editable text) and a single "label"
(StringMorph). I want the act of clicking on a button to change the
value (contents) of the StringMorph. I gave the StringMorph a new
instance variable called "value" and I've browsed the StringMorph and
determined that it has a method called contents: which should be used to
set its value but what I can't for the life of me figure out is how to
reference the StringMorph.
I suspect this is becauase you're managing so much of the model "under
the covers" as you said in your earlier message to Ryan Davis. But I do
notice that it has an instance variable called contents which contains
its displayed value. If I edit this value in an inspector and accept the
change, though, the displayed value of the StringMorph doesn't change.
(That didn't particularly _surprise_ me but it kept me in my quandary.)
While I'm at it, how, if at all, can I take a custom morph and put it
into a Parts Bin so that I can later instantiate it anew? Or has morphic
proceeded that far yet?
Dan Shafer, Looking at Technology from Every Angle
Home Page: http://www.gui.com - Email: dan at gui.com
There is nothing more powerful than an idea whose time has come.
More information about the Squeak-dev