<div dir="ltr">Hi Tty,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 5:11 AM, gettimothy <span dir="ltr">&lt;<a href="mailto:gettimothy@zoho.com" target="_blank">gettimothy@zoho.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><u></u><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">Henry, Bob and Eliot.<br><br>
Thanks all.<br><br><br><br>After I study what Eliot wrote and devise my plan, I will post it back here. <br>Bear in mind that I am new to this. I am experiencing the same difficulty in thinking &#39;VM&#39; vs &#39;Smalltalk&#39; as I did when thinking &#39;Smalltalk&#39; vs &#39;Algol&#39;;<br>
I am sure the light bulb will come on (40 Watt, sadly) eventually, but expect missteps.<br><br><br>BTW, is there an existing working process that the Simulator currently does that I can use as a model? I was planning on mapping what Eliot wrote to <br>
what I can see in the Simulator&#39;s command window menu as a starting point to get a feel for things. Good place to start ?<br></div></div></blockquote><div><br></div><div>Sure.  But you&#39;re going to add event handler code to where that window is created which is StackInterpreterSimulator&gt;&gt;openAsMorph.  You&#39;re going to need a new inst var in StackInterpreterSimulator to hold the event.  As Bob says (wish I&#39;d said it too but I couldn&#39;t find it) the Morphic events may hold onto their OS events anyway so you may not even have to convert.</div>
<div><br></div><div>Anyway, dive in, get your hands dirty, and you don&#39;t have to commit your mistakes, so we&#39;ll never know, only see the shiny finished product ;-)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">cordially,<br><br><br>tty<br><div><br>---- On Thu, 23 Jan 2014 03:32:32 -0800 <b>Bob Arning &lt;<a href="mailto:arning315@comcast.net" target="_blank">arning315@comcast.net</a>&gt;</b> wrote ---- <br>
</div><br><blockquote style="border-left:1px solid #0000ff;padding-left:6px;margin:0 0 0 5px">               <div text="#000000" bgcolor="#FFFFFF">     <font face="Georgia">I don&#39;t think there is any reason to convert to       an OS array - HandMorph&gt;&gt;processEvents already knows the OS       event array that was used to generate the squeak event. Making       that accessible may be all you need from the front end.<br>
       <br>       Cheers,<br>       Bob<br>       <br>     </font>     <div>On 1/23/14 4:43 AM, Henrik Johansen       wrote:<br>     </div>     <blockquote><a href="mailto:31-9AAB-46F2-BE03-164F3C2C6759@veloxit.no" target="_blank">31-9AAB-46F2-BE03-164F3C2C6759@veloxit.no</a>&quot; type=&quot;cite&quot;&gt;       <pre>
 </pre>       <br>       <fieldset></fieldset>       <br>              <br>       <div>         <div>On 22 Jan 2014, at 7:05 , Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;           wrote:</div>
         <br>         <blockquote type="cite">           <div style="font-family:helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
So your             challenge is to take the Morphic event, queue it inside             StackInterpreterSimulator (e.g. in a new inst var             eventQueue), and convert it to an OS event (an Array), so             that it can for example implement ioGetNextEvent: as             something like</div>
           <div style="font-family:helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br>           </div>           <div style="font-family:helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
             <div>StackInterpreterSimulator&gt;&gt;ioGetNextEvent: evtBuf</div>             <div><br>             </div>             <div><span style="white-space:pre-wrap"> eventQueue                 isEmpty ifTrue:</span></div>
           </div>           <div style="font-family:helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="white-space:pre-wrap">               <div style="white-space:normal"><span style="white-space:pre-wrap"> </span><span style="white-space:pre-wrap"> [^</span>self                 primitiveFail].</div>               <div style="white-space:normal">
<br>               </div>             </span></div>           <div style="font-family:helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="white-space:pre-wrap"> self convertMorphicEvent:               eventQueue removeFirst into: evtBuf</span></div>         </blockquote>       </div>       <br>       <div>As for the conversion into the OS array, searching for &quot;Event         Types” in sq.h will probably give a better introduction/faster         understand as to the structure of said array than delving into         the code doing array -&gt; morphic event conversion in an image.</div>
       <div>Make sure you get WindowEvent type 6 correct! :)</div>       <div><br>       </div>       <div>Cheers,</div>       <div>Henry</div>     </blockquote>     <br>    </div></blockquote><br></div></div><br></blockquote>
</div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>