Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

creating a tcl-driven multi-platform interface toolkit

1 view
Skip to first unread message

Mark Roseman

unread,
Mar 1, 1994, 11:07:50 PM3/1/94
to
We've all been talking about getting Tk running on Mac and Windows,
and we all realistically know this is never going to happen unless
you run it inside an X server, which is wholly unsatisfactory.
So if thats not going to work, yet if many of us thing it would be
a "good thing", how do we proceed?

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

Read Fleming

unread,
Mar 7, 1994, 9:50:50 AM3/7/94
to
Actually, the first order of business is to make core Tcl portable and
a "good citizen" across more than UNIX systems.


0 new messages