








Squeak GtkPlugin on Win32
2004-04-01: (not an april's joke)
A little new binary download, it is not THAT exciting because you can't really do anything with it yet - but there is an example with simple button click callbacks. Just unzip in you Squeak image dir (quite a bunch of files):
gtksqueak-2004-04-01.zip
...file in "Gtk.st" into a 3.6-basic image and then play with the example methods in class Gtk. No time to write more instructions right now. :)
Also a quick zip of source and tweaked makefile on win32 (note that getting this stuff to compile properly takes quite a bit of work - I even had to rename library files etc - and don't ask me because I don't have time right now :)):
GtkPlugin-2004-04-01.zip
2004-03-16: Just threw together a binary download for people to play with. It is not THAT exciting because you can't really do anything with it yet. Just unzip in you Squeak image dir (quite a bunch of files) gtksqueak.zip, file in "Gtk.st" then play with the method Gtk class>>test. No time to write more instructions right now. :)
I will be writing more about this but in short I have:
- Used Andreas build structure and tools download and created a GtkPlugin class using SmartSyntaxInterpreterPlugin.
- The plugin only has 2 primitives so far:
- loadXML: it takes a String containing a Glade XML description, creates such a UI using Gtk2/libglade/libxml2, and opens it up.
- mainIterationDo: takes a boolean and runs one iteration of the Gtk2 event loop. The boolean decides if it should block.
I have struggled quite a fair bit with the linking, compiler settings, downloading libs, figuring out where to put them yaddayadda etc - phew. But now I at least have a screenshot to show you! :)
To drive the event loop I just used:
[gtk := GtkTest new.
dl := Delay forMilliseconds: 10.
[true] whileTrue: [
dl wait.
gtk mainIterationDo: false]] forkAt: Processor userBackgroundPriority
Will see how to handle it later on, probably spawn a thread in the plugin. Need to look how SocketPlugin etc does it.
In the screenshot you can see that I pass a Glade XML UI description as a String into the GtkPlugin. It then uses libglade which in turn uses libxml2 and gtk2 to construct the UI and open it up.
