The GUI to end all GUI libraries (Let's Dream!)

Bill Baxter dnewsgroup at billbaxter.com
Mon Nov 26 17:44:38 PST 2007


(with a nod to Don ;)
No, I don't have the perfect GUI.
I'm just throwing this out as a topic for discussion.  I've yet to find 
a GUI that isn't tedious to use.  With 2.0 const hopefully nearing 
completion, and the new closure support in 2.0, maybe it's a good time 
to dream again about what the ultimate D GUI would look like.

I don't have anything concrete, but I was thinking a bit about some 
interesting GUI-ish things from Python recently and thought I'd mention 
them here.

There's a library called "Trellis" [1] that I think has an interesting 
idea for how to maintain GUI state.

The basic idea is that you define rules rather than explicit event 
handlers, and execution of those rules is triggered by built-in 
dependency analysis.  The analogy made on the web page is to a 
spreadsheet.  When you use a spreadsheet you just say how the values in 
this cell depend on all the others and then it all gets automagically 
updated for you recursively whenever any dependency changes.

So I wonder if something like this could be done in D.  Or is there 
something about the dynamic nature of Python which allows this sort of 
idea, but makes it unworkable in a static language like D?

Anyway it's a neat idea that seems to me to have potential to take us 
beyond the same old event-driven paradigm that's been rehashed for years 
and starts to get quite cumbersome beyond a certain point.

Another interesting GUI-related lib from Python-land that I have my eye 
on is Traits from Enthought [2].  Traits are sort of objects that wrap a 
state value and automatically generate callbacks.  So the core actually 
doesn't have anything to do with GUI-ness.  More like a mechanism for 
state managment + signals.  But Traits also work with TraitsUI to create 
GUIs automatically from your Traits with very little extra coding.  That 
part seems quite useful for creating quick GUI scripts and mockups, but 
less useful for creating a big app like an IDE.  I haven't worked with 
Traits much, though, so maybe it scales up better than I think.


--bb

Links:
[1] http://cheeseshop.python.org/pypi/Trellis/0.5b1
[2] http://code.enthought.com/traits/



More information about the Digitalmars-d mailing list