[Vm-dev] How to Send a Message to the Squeak Image

Igor Stasenko siguctua at gmail.com
Sun Mar 2 02:25:30 UTC 2008


On 02/03/2008, Rob Rothwell <r.j.rothwell at gmail.com> wrote:
>
> Hello,
>
> Please let me know if this is a very VM question, and I will make sure to
> post it on the Beginners list instead...
>
> Anyway...I would like to use Squeak as a background tray application in
> Windows with a dynamic right-click menu depending on the state of my
> application.  I have successfully modified and compiled a
> "SqueakVM-Win32-3.10.6" package to include an "options menu" for the taskbar
> icon.
>
> Keeping the menus in sync could be done using an INI file the same way as
> the preference menu functionality in sqWin32Prefs.c, but with custom message
> ID's listed there as well.  However, having never poked around in the VM
> before (and being years since I did anything in C), I was wondering if
> someone could point me in the right direction to post a message from within
> the Windows message loop that the interpreted image would see.
>
> This is obviously being done to pass keyboard and mouse events back and
> forth...I was just hoping someone could help me narrow down my search to
> find the correct functions to call on the C-side, and the correct way to
> listen for the message on the Smalltalk side!
>

Well, you can do in similar way how VM does for transferring user
input to Smalltalk side.

In VM:
- add some variable(s) to hold your event parameters
- on some event, handled by windowProc(), set these parameters, and
signal semaphore.
- add primitive which when called, transforms event parameters to objects.
- add primitive to register given semaphore , which will be signaled
when event occurs

In smalltalk:
- call primitive to register semaphore
- create process, waiting on given semapore, once it signaled, call
primitive to read event details.

> Thanks,
>
> Rob Rothwell
>
>
> --
> The foolish reject what they see, not what they think; the wise reject what
> they think, not what they see.  -- Huang Po
>


-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list