[squeak-dev] Squeak Callbacks support

Philipp Tessenow philipp.tessenow at student.hpi.uni-potsdam.de
Sun Jul 26 19:37:30 UTC 2009


Hello Kiran,

as far as I know the Alien FFI supports callbacks
(http://wiki.squeak.org/squeak/6100).
It looks pretty cool, but the wiki page says it supports Mac only, so if
you want callbacks in Unix or Windows you may go another way:

Fork a new process that waits on a registered semaphore ('semaIndex :=
Smalltalk registerExternalObject: (example_semaphore).').
Then write a Squeak plugin that implements the callback you need. Every
time your callback is called, signal the registered semaphore
('interpreterProxy->signalSemaphoreWithIndex(semaIndex)') so your Squeak
process can do whatever it needs to do.

See http://www.hpi.uni-potsdam.de/hirschfeld/projects/phidgetlab/ for an
example of the second way.

I hope that helps ;)

Best regards,
  Philipp


KiranMutt schrieb:
> Hello:
> 
> I am working at interfacing an external C library ( static/dynamic ), in
> that context wanted to know,
> whether  Squeak supports callbacks and any examples on using the same is
> highly appreciated.
> 
> Thanks & Regards
> Kiran
> 



More information about the Squeak-dev mailing list