Hi Tty,


On Thu, Jan 23, 2014 at 5:11 AM, gettimothy <gettimothy@zoho.com> wrote:
 
Henry, Bob and Eliot.

Thanks all.



After I study what Eliot wrote and devise my plan, I will post it back here.
Bear in mind that I am new to this. I am experiencing the same difficulty in thinking 'VM' vs 'Smalltalk' as I did when thinking 'Smalltalk' vs 'Algol';
I am sure the light bulb will come on (40 Watt, sadly) eventually, but expect missteps.


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
what I can see in the Simulator's command window menu as a starting point to get a feel for things. Good place to start ?

Sure.  But you're going to add event handler code to where that window is created which is StackInterpreterSimulator>>openAsMorph.  You're going to need a new inst var in StackInterpreterSimulator to hold the event.  As Bob says (wish I'd said it too but I couldn't find it) the Morphic events may hold onto their OS events anyway so you may not even have to convert.

Anyway, dive in, get your hands dirty, and you don't have to commit your mistakes, so we'll never know, only see the shiny finished product ;-)

cordially,


tty

---- On Thu, 23 Jan 2014 03:32:32 -0800 Bob Arning <arning315@comcast.net> wrote ----

I don't think there is any reason to convert to an OS array - HandMorph>>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.

Cheers,
Bob

On 1/23/14 4:43 AM, Henrik Johansen wrote:
31-9AAB-46F2-BE03-164F3C2C6759@veloxit.no" type="cite">
 



On 22 Jan 2014, at 7:05 , Eliot Miranda <eliot.miranda@gmail.com> wrote:

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

StackInterpreterSimulator>>ioGetNextEvent: evtBuf

eventQueue isEmpty ifTrue:
[^self primitiveFail].

self convertMorphicEvent: eventQueue removeFirst into: evtBuf

As for the conversion into the OS array, searching for "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 -> morphic event conversion in an image.
Make sure you get WindowEvent type 6 correct! :)

Cheers,
Henry






--
best,
Eliot