[Idle-dev] IDLE "shell" (was: IDLE interpreter window)

Martijn Faassen faassen@vet.uu.nl
Wed, 8 Mar 2000 19:18:05 +0100


Guido van Rossum wrote:
> > Another approach maybe would be to add an additional layer between
> > the functonality you want to have and the Tk text widget.  In such a
> > design it would be easier to change the underlying GUI toolkit to
> > something else than Tk, in the case that someone wants to port idle
> > to this other toolkit, or for the case that some other GUI toolkit
> > evolves to become the defacto standard toolkit of Python.
> 
> This is a popular meme: introduce an extra abstraction layer to
> isolate you from the GUI toolkit du jour.  It has been hashed to death
> many times in c.l.py and elsewhere -- there even was a SIG devoted to
> GUIs that did nothing but discuss such designs.

The difference is that we're talking about a single application here,
and that was about a GUI abstraction layer. In fact, most GUI toolkits *are*
abstraction layers over the real GUI; Tk is, wxWindows is, GTK is and Qt is
too.

A GUI abstraction layer for a specific application is easier to do than a
general abstraction layer. This kind of abstraction is called
'View-Model-Controller', I thought.

> It doesn't work very well, because typically, the GUI toolkit of
> tomorrow contains features that aren't in the abstraction layer of
> today, and in the mean time the abstraction layer is either
> heavy-weight or lowest-common-denominator, and in both cases people
> find ways around it out of necessity (performance or the desire to do
> things "just like reall apps do").

That's true for the general abstraction layer, but for IDLE, we can of
course make our own fine tuned abstractions for whatever we want to do.
Lots the IDLE source of course is already like that, but it would be nice if
more was. I think with application specific GUI abstraction you can actually
exploit features on GUIs where they are avaible.
'highest-common-denominator' :)

Trying to abstract about the GUI for IDLE might make the design cleaner and
increase portability to other GUI toolkits. I'll admit that I have an
interest here; I think such portability would be very nice, especially for
environments like the KDE and Gnome desktops.

The other objection, that the system becomes too heavy weight, may or may
not go away if you do application specific GUI abstraction. I don't really
know enough about Tkinter to judge this.

Regards,

Martijn