Still trying to kill that pesky morph......
Ned Konz
ned at bike-nomad.com
Sun Oct 21 22:25:40 UTC 2001
On Sunday 21 October 2001 01:48 pm, John Hinsley wrote:
> Well, that's what I've been trying to do (in my clumsy sort of way). But
> the problem seems to be that unless I can address the morph by
> (something like) worldtime2475 (or a variable representing that)
> "delete" simply isn't understood (I guess that this works like pid:
> without the number, I could be referring to an infinite number of
> WorldTimeMorphs). And I can't work out how to set or get that number
> (without dragging the damn morph onto the workspace, and, of course, the
> number changes every time an instance of the Morph is created, which is
> where we came in....). Even my attempts to write a "kill" method for
> WorldTimeMorph have come to naught (and that seems a strange way of
> doing it: it should be possible to use Morph's delete).
>
> There's a lot here I don't understand (clearly!). But most obviously, I
> don't understand the relationship between morphs and submorphs and
> between properties and submorphs. I'm hopeless!
What is the code you're using to construct the WTM? If it's something like:
WorldTimeMorph new openInWorld
then you can just go:
wtm _ WorldTimeMorph new openInWorld.
"and later"
wtm delete.
Or to delete all WorldTimeMorphs from the current world:
World allMorphsDo: [ :ea | (ea isKindOf: WorldTimeMorph) ifTrue: [ ea delete
]]
--
Ned Konz
currently: Stanwood, WA
email: ned at bike-nomad.com
homepage: http://bike-nomad.com
More information about the Squeak-dev
mailing list
|