How do I wait for HandMorph>>openInHand to complete?

Trygve Reenskaug trygver at ifi.uio.no
Sun Aug 22 15:59:55 UTC 2004


Karl, Ned,
Many thanks for your suggestions. The following executed in a workspace 
demonstrates the problem:

    symbol := Morph new.              " create "
    symbol openInHand.                  " place "
    (ActiveWorld submorphs includes: symbol) ifFalse: [self error]. " Use. "

This test fails. But the last statement does not fail if I select and doIt 
after having placed the new morph.

The problem is clearly non-trivial.

I have tried waiting after the openInHand:
    ActiveWorld doOneCycle.              " try to wait - 1. "
    ActiveWorld doOneCycleNow.           " try to wait - 2. "
    ActiveWorld runLocalStepMethods.     " try to wait - 3. "
No help there.

I have tried
    symbol := Morph new.              " create "
    symbol openInHand.                  " place "
    WorldState addDeferredUIMessage:
         [(ActiveWorld submorphs includes: symbol)   " use "
                       ifFalse: [self error] ]
No change.

I'm running Squeak3.6-5429-full. There is no addedMorph: method in the 
whole system. (It is a feature of 3.7)

Morph>>intoWorld: runs when owner is set, but the morph is not yet 
positioned. So it runs before openInHand returns. A halt shows that it is 
in the same thread as the triggering menu command and openInHand. But the 
positioning is independent of this thread and takes place while the halt 
debugger is open.

Amazing.
--Trygve



-- 

Trygve Reenskaug      mailto: trygver <at> ifi.uio.no
Morgedalsvn. 5A       http://heim.ifi.uio.no/~trygver
N-0378 Oslo           Tel: (+47) 22 49 57 27
Norway

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040822/a244807e/attachment.htm


More information about the Squeak-dev mailing list