<html>
<body>
<font size=3>Ploblem resolved!<br>
The problem was that I want to do things after
<i>Morph&gt;&gt;openInHand</i> has completed placing a new <i>morph
</i>on a canvas. I have received some interesting pointers, but the short
answer is that it cannot be done.<br><br>
I believe I understand what is happening. Open an inspector on
<i>ActiveHand </i>and select 'submorphs'. It is an empty Array. Keep the
inspector open while you run this code in a Workspace:<br>
&nbsp;<i> morph := Morph new. &quot; create &quot;<br>
&nbsp; morph openInHand.&nbsp;&nbsp; &quot; place &quot;<br>
&nbsp; Transcript show: ActiveHand submorphs.<br>
</i><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>
The <i>morph </i>is attched to the <i>ActiveHand</i>; you can see that
its submorphs now includes it. The stack is actually 37 deep just after
the <i>openInHand</i>:  <br><br>
<i>1: (3840) UndefinedObject/DoIt {#(a Morph(3795))}<br>
2: (2724) Compiler/evaluate:in:to:notifying:ifFail:<br>
3: (709) TextMorphEditor/evaluateSelection<br>
...<br>
25: (2920) HandMorph/sendFocusEvent:to:clear:<br>
26: (2920) HandMorph/sendEvent:focus:clear:<br>
27: (2920) HandMorph/sendKeyboardEvent:<br>
28: (2920) HandMorph/handleEvent:<br>
29: (2920) HandMorph/processEvents<br>
30: (3742) WorldState/doOneCycleNowFor:<br>
31: (3258) Array/do:<br>
32: (3742) WorldState/handsDo:<br>
33: (3742) WorldState/doOneCycleNowFor:<br>
34: (3742) WorldState/doOneCycleFor:<br>
35: (905) PasteUpMorph/doOneCycle<br>
36: (2445) Project class/spawnNewProcess<br>
37: (283) BlockContext/newProcess<br><br>
</i>Activations return after the <i>Transcript </i>statement until
<i>ActiveHand </i>gets control again (<i>WorldState&gt;&gt;processEvents
</i>?). <i>ActiveHand </i>with its attached <i>morph </i>is visible on
the screen and follows the cursor until the user presses the red button.
<i>ActiveHand </i>returns the <i>morph </i>to its real owner, removing it
from its <i>submorphs</i>. You can see this if you put this trace in
<br>
&nbsp;&nbsp;&nbsp;&nbsp; <i>Morph&gt;&gt;privateOwner:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Transcript show:
aMorph.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br><br>
</i>The conclusion is that there is indeed a single input process. But
the <i>openInHand </i>mechanism can only be understood by considering the
stack. There is no way I can wait until <i>morph </i>has been positioned,
because the positioning only starts after I have returned.<br><br>
This very cool software leaves me cold. Since I do not want to do other
things before the positioning completes, I replace it with a simple and
transparent mechanism a la Rectangle&gt;&gt;fromUser<br><br>
Cheers<br>
--Trygve <br><br>
<br><br>
<br>
Earlier mail:<br>
<blockquote type=cite class=cite cite>Karl, Ned,<br>
Many thanks for your suggestions. The following executed in a workspace
demonstrates the problem:<br><br>
&nbsp;&nbsp; <i>symbol := Morph
new.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; create &quot;<br>
&nbsp;&nbsp; symbol
openInHand.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; place &quot;<br>
&nbsp;&nbsp; (ActiveWorld submorphs includes: symbol) ifFalse: [self
error]. &quot; Use. &quot;<br><br>
</i>This test fails. But the last statement does not fail if I select and
<i>doIt </i>after having placed the new morph.<br><br>
The problem is clearly non-trivial. <br><br>
I have tried waiting after the openInHand:<br>
&nbsp; <i>ActiveWorld
doOneCycle.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; try to wait - 1. &quot;<br>
&nbsp;&nbsp; ActiveWorld
doOneCycleNow.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; try to wait - 2. &quot;<br>
&nbsp;&nbsp; ActiveWorld runLocalStepMethods.&nbsp;&nbsp;&nbsp;&nbsp;
&quot; try to wait - 3. &quot;<br>
</i>No help there.<br><br>
I have tried<br>
&nbsp;&nbsp; <i>symbol := Morph
new.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; create &quot;<br>
&nbsp;&nbsp; symbol
openInHand.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot; place &quot;<br>
&nbsp;&nbsp; WorldState addDeferredUIMessage: <br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>[(ActiveWorld
submorphs includes: symbol)&nbsp;&nbsp; &quot; use &quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ifFalse: [self error] ]<br>
</i>No change.<br><br>
I'm running Squeak3.6-5429-full. There is no <i>addedMorph:</i> method in
the whole system. (It is a feature of 3.7)<br><br>
<i>Morph&gt;&gt;intoWorld:</i> runs when owner is set, but the morph is
not yet positioned. So it runs before <i>openInHand </i>returns. A halt
shows that it is in the same thread as the triggering menu command and
<i>openInHand</i>. But the positioning is independent of this thread and
takes place while the halt debugger is open.<br><br>
Amazing.<br>
--Trygve</blockquote><br>
<x-sigsep><p></x-sigsep>
-- <br><br>
Trygve Reenskaug&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mailto: trygver &lt;at&gt;
ifi.uio.no<br>
Morgedalsvn. 5A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://heim.ifi.uio.no/~trygver" eudora="autourl">http://heim.ifi.uio.no/~trygver</a><br>
N-0378 Oslo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Tel: (+47) 22 49 57 27<br>
Norway<br>
</font></body>
<br>
</html>