Still trying to kill that pesky morph......

Andreas Raab Andreas.Raab at gmx.de
Sun Oct 21 04:32:12 UTC 2001


John,

> Any ideas welcomed: I'd have thought this would be easy, but
> it seems to be neither easy nor documented!

How about simply giving your morph a name (CMD-click on it and rename it to
'Foo') and then:
	worldTime := World submorphNamed:'Foo'.

[BTW, it might be helpful to explain the scenario in which you need this
reference - reading your message I couldn't figure out at all why I would
want to have a textual reference if you don't want to have people using the
UI after all]

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org
> [mailto:squeak-dev-admin at lists.squeakfoundation.org]On Behalf Of John
> Hinsley
> Sent: Saturday, October 20, 2001 9:08 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Still trying to kill that pesky morph......
>
>
> Here's the scenario:
>
> Open any Morph, open a workspace. Select, from the workspace menu
> "create textual references to dropped morphs" drag the morph into the
> workspace.
>
> I get:
>
> WorldTimeMorph initializeLocally.
> worldtime1527 (the number you get will be different!)
>
> I can then do:
>
> worldtime1527 delete
>
> And the morph vanishes.
>
> The problem is that in an interface, you can't really have people
> dragging morphs around. And I don't want people to have to
> click on the
> X to delete the morph. I need to be able to put together some
> code which
> will enable the morph to be zapped.
>
> In short, I need a getter (at least) and (preferably) setter for that
> "textual reference". And after a day of messing around, all I can come
> up with is identityHash which returns a number, but the wrong one (for
> the morph, at least!). Aaargh!!!!
>
> Any ideas welcomed: I'd have thought this would be easy, but
> it seems to
> be neither easy nor documented!
>
> Cheers
>
> John
>
>
>
>
> --
> If you don't care about your data, like file systems which
> automagically
> destroy themselves and have money to burn on 3rd party tools to keep
> your
> system staggering on, Microsoft (tm) have the Operating
> System for you.
>
>





More information about the Squeak-dev mailing list