For the product I'm working on now, we're using XVT, which is a
platform independent GUI library that kinda works. Now let me
finish, I'm not advocating such a library for our purposes here!
Anyway, I did a Tcl front end to XVT that lets me do a good
deal from Tcl scripts. More interestingly, the Tcl-XVT front end
was actually surprisingly short, owing to it being largely
implemented in Tcl itself, with about a dozen C primitives which
hook into the XVT libraries (513 lines of Tcl, 369 lines of C).
It does (at last count): top level windows, frames, labels,
buttons, edit text, checkboxes, radio buttons, groupboxes,
listboxes and comboboxes (which are all in XVT, but it gives
you a feel for how much work to get how much benefit).
One comment about XVT itself; it takes very much a "lowest common
denominator" approach across platforms. Looking at the resulting
code I can see easily how to modify it to work native for a Mac
or (from my happily limited understanding) native Windows, and
certainly easily enough on X (my preference would be to rewrite
as Tk commands of course).
So here are my lessons learned from that experience that can apply
to doing a real native cross platform Tcl based GUI thingy:
- don't even think about doing something Tk compatible; think
about something that could use Tk underneath for the X port
- if we're creating a new language, come up with a spec for it
first off
- build it on one platform, using as much tcl as you can and as
few C calls as you can (i'm not advocating being silly here;
a C call that is gui_do_everything will not help. think about
real primitives that can be combined in useful and meaningful
ways.. you know, how Tcl is supposed to be used!)
- from that generate a list of C primitives
- find people familiar with other platforms and start fighting about
the primitives
- throw out whatever you did the first time and build it properly
I can probably release the spec that I did about the language I
defined, but not the code itself (although I can describe the
approach I took with it in glorious detail).
The real problem behind all of this port stuff is really resources
I guess; this won't fly by purely volunteer efforts on behalf of
people already with full-time jobs or who should be working on
their theses (hi Earle!). :-)
So I just thought I'd throw this out for discussion.
Mark
p.s. cross platform groupware toolkit coming soon... ;-)
--
Mark Roseman email: ros...@edm.isac.ca
Integrated Systems Applications Corp. phone: (403) 420-8081
Edmonton, Alberta, Canada fax: (403) 420-8037