Michael Kleiber wrote:
> I recently began programming with the 1.0 Croquet and quickly stumbled
> upon a problem. How do I remove Objects (TFrames) after I added them
> dynamically to my root space?
Just the way you did it. Using addChild:, removeChild: and hasChild: is
> When I keep myTFrame as an instance Variable and try to check later if
> the space already has this particular object I do not get reasonable
> answers - trying to #removeChild: does nothing:
> root future hasChild: myTFrame
> returns a TFarRef with value false
This is odd. It should definitely work unless there is something funky
with your replica in the above. Try the following to see if it works:
harness activeSpace future addChild: myFrame.
p := harness activeSpace future hasChild: myFrame.
p wait. "until completed"
p value ifFalse:[self error: 'Something is horribly broken'].
The only difference to your code is that I'm using
CroquetHarness>>activeSpace instead of querying the replica's root. This
shouldn't be much of a difference but I have successfully used the above
pattern and I don't think I've ever used the pattern you were using. If
this variant works and yours doesn't then we know where to look.