[ANN] Preview of Squeak interface to wxWidgets

Rob Gayvert rtg at rochester.rr.com
Wed Apr 28 01:04:31 UTC 2004


>> On Apr 27, 2004, at 6:06 PM Avi Bryant wrote:
> 
> >   - Uses synchronous callbacks to Squeak via interpret()
> 
> Can you elaborate on this?  I've always understood that this was a Bad 
> Idea, though never entirely grokked why.  It sounds like you had to 
> make some modifications to get this to work - are they modifications 
> that would make sense to incorporate into the base VM, and if not, why 
> not?  Naively, it sure would be nice to have something like 
> interpreterProxy->perform(oop, selector, args) ...
> 

It's certainly nontrivial, but if you want to take full advantage of
a GUI library like wxWidgets, you have to have synchronous callbacks to
support things like vetoing events and validators. I started with some
ideas that Andreas outlined in a posting a couple of months ago (6 Feb).
The basic idea is that when a primitive is called, the interpreter is 
in a reentrant state ("externalized"), so you can call interpret() again
as long as you prepare the Smalltalk side for the callback and have a
way of exiting the second call to interpret(). Andreas suggested using
setjmp/longjmp to return to the original frame. I found this worked well
for the simple case, but had trouble keeping track of the jump buffers in 
nested scenarios, so I opted to modify the interpreter loop to use
"while(interpreterRunning)" instead of "while(1)". 

My current scheme works for the samples I've done so far, but it needs
more work. As soon as I get it cleaned up a bit, I'll post the VM and 
plugin sources as well.

.. Rob








More information about the Squeak-dev mailing list