Squeak+GTK (and Tk)

David T. Lewis lewis at mail.msen.com
Mon Apr 24 12:20:44 UTC 2000


On Mon, Apr 24, 2000 at 07:21:08AM -0400, Andrew C. Greenberg wrote:
> Early on, I looked into implementing a Tk/Tcl interface, akin to 
> Python's Tkinter.  That project was stopped primarily because of the 
> inability to effectively arrange for a function callback.  No present 
> approach to external primitives provides decent capabilities in this 
> regard.  You may wish to consider whether this facility is necessary 
> or desirable before beginning this work, or to focus your efforts at 
> that issue first.

For what it's worth, I've done a Tk interface proxy for Squeak. It 
works but is not yet useful.

The approach I took is to use an unmodified Tk wish shell to run all the
Tk objects, and talk to the wish shell through pipes (using OSProcess
on Unix). I use proxies on the Smalltalk side to represent Tk objects,
with bidirectional communication of events to keep things in sync.
A TkProxy object waits on a semaphore and handles events from the
remote wish shell by dispatching them to their respective Smalltalk
proxy objects.

It works fine so far, but still lacks a few things:

1) I need event driven input from the connected pipe (currently I'm
using a brute-force polling loop just to get things running). Hopefully
I'll figure out a clean way to get this into OSProcess.

2) I may try a socket stream connection, rather than the Unix pipe
connection. This would solve #1, and would be platform independent, but
it's not a very secure way to do things.

3) A full implementation of proxies for Tk objects. So far, I've just
done proxies for a few simple buttons and lists.

I'll post if and when I get it to a reasonable state of completion.

Dave





More information about the Squeak-dev mailing list