[IDEA] Gtk2.0 and Squeak in the 'real boring world'

Nahuel Greco nahu at softhome.net
Wed Jun 19 18:40:49 UTC 2002


Hi, I want share an idea of how to make Squeak more "real world" friendly. 

Anti-flame Disclaimer:

I think that Squeak must strongly keep their research objectives, but at
the same time, we don't live in a perfect world. There are projects were
alternative interfaces are not an option, maybe projects that can gain
big benefits if were created with Squeak (or at least, reduce programmer
headaches). Also, making more feasible to create "boring commercial" apps
in Squeak will help to grow his user base, and in the end, attract more
people to the Morphic world. And no, I don't want to use commercial
smalltalks. 

Idea:

GTK 2.0 is based in a "dynamic OO" system builded over C (not C++). All the
widgets are based in the "GObject" struct. You can query it at runtime for
all the "types" (classes) registered, their properties, methods, etc. It
has a lot of introspection and runtime binding facilities to make language
wrappers a breeze to code (with call-backs support, sub-classing, etc).

So, this very different and much more easy to do that make bindings using
SWIG or other source code parsers for GTK1, QT, wxWindows, etc. You can
compare it with creating a bridge with the Mac OSX (or GNUStep) ObjectiveC
runtime.

If I understand well all of this, a person with experience in Squeak/FFI,
can build a GObject interface in little time, making all GTK2 (and the
extra widgets in each system) available from Squeak. So, using a
"boring-real-world-but-pay-bills-capable-interface" from Squeak is possible,
with the GTK benefits: a very good toolkit, very big community behind it,
coded in a portable fashion, (but the Win32 port lags a little), etc. It is
LGPL, so.. no problem (sure?)

Again, I don't propose to include this in the main Squeak distribution. What I
want is to have the "normal" Squeak window opened, do my real work in that
window, using all the Squeak tools, but seeing the GTK windows created from my
Squeak 'program'. When the code reach production or release stage, I simply
make an executable that calls squeak headless with my image, and what only
is showed is the GTK interface, making it appear as any standard app. 

An "advanced" feature can be the possibility of using "Squeak areas" as
GTK custom widgets inside GTK applications (stupid example: draw a chart
using morphic in that Squeak area, inside a boring GTK financial app),
but I don't know the feasibility of this.

Other option is to add multi window capabilities to Squeak and write a good and
boring widget library :)

I don't have the time or (for now) the Squeak/FFI knowledge to make this
possible, so, feel free to do with this what you want :)

So.. it is really so easy to make the gtk2 bindings?, what do you think?

Some Links:

"Writing Language Bindings for GTK+ 2.0 (draft)", the author is the creator of
the python bindings:

       http://www.gnome.org/~james/language-bindings/ 

       http://developer.gnome.org/doc/API/2.0/gobject/gobject-signals.html

Guile GObject wrapper:

        ftp://ftp.gnome.org/pub/GNOME/earthquake/sources/guile-gobject/guile-gobject-0.2.0.tar.gz

Note, there are tools to build XML descriptions of GTK interfaces:
        
        http://glade.gnome.org/


- Nahuel Greco            Web Development - Open Source - 
- http://www.codenix.com  Game Programming - Research   -
- Coding / sysadmin       Networking. The answer is 42. -



More information about the Squeak-dev mailing list