Improving the aesthetics and usability of Squeak

Ian Piumarta ian.piumarta at inria.fr
Tue Jul 9 15:20:24 UTC 2002


On Tue, 9 Jul 2002, Andreas Raab wrote:

> > The "trick" is to implement callbacks, which requires some
> > VM/Squeak compiler support.
> 
> I don't know how often I have said this but for the majority of stuff
> you may want to do you do *NOT* need callbacks.

I almost replied to the post saying the same thing, but you went and said
it better.

> AFAIK, the same is true for X11 (XNextEvent or what it's called) and
> MacOS (don't remember the exact name for the call).
> 
> There are a few things that you cannot do this way (just because the OS
> API provides no "polling interface" for it)

There are no callbacks in X11.  Everything is events.  If you want
callbacks then you need to be using at least the intrinsics on top of
Xlib.  (And the main reason for using the intrinsics at all is that you've
decided explicitly to implement a callback-based application.)

> Try to be a bit creative!

Exactly.  E.g., just move the layer that implements callbacks into Squeak.
And if your particular window/widget system insists on using callbacks you
can still do it by having tiny callbacks (written in C) that stash their
arguments someplace safe and then signal semaphores to wake up waiting
processes inside the image.  A long time ago I built a Smalltalk binding
to Tk in exactly this manner.

Ian





More information about the Squeak-dev mailing list