Building a GUI Toolkit

Lie Ryan lie.1296 at gmail.com
Tue Apr 20 14:53:17 EDT 2010


On 04/19/10 03:06, Martin P. Hellwig wrote:
> On 04/18/10 12:49, Tim Diels wrote:
>> Hi
>>
>> I was thinking of writing a GUI toolkit from scratch using a basic '2D
>> library'. I have already come across the Widget Construction Kit.
>>
>> My main question is: Could I build a GUI toolkit of reasonable
>> performance with the Widget Construction Kit, would it still feel more
>> or less lightweight? By reasonable I mean that the user wouldn't think
>> of the interface as being slow or unresponsive.
>>
>> I've also thought of using pyglet to build widgets with, but this would
>> seem to be overkill. As a side question: by using opengl, the work would
>> be delegated to the GPU rather than the CPU; is this always a good
>> thing, or does it have downsides as well (performance, power usage, ...)?
>>
>> Are there any other libraries that may be of interest to me?
>>
>> Thanks in advance
> 
> It probably depends on how low level you want to go, I have pondered
> about the possibility myself to have an all python(ic) gui toolkit,
> capable of writing a (x11) windowing manager itself with.
> But I decided that using tkinter and just live with its rough corners is
> more bang for the buck for me than to reimplement tkinter badly.
> 

Rather than writing a windowing toolkit from the low-level, I would
rather like to see some wrapper for existing windowing toolkit which
uses more pythonic idioms.

Most popular python GUI toolkit currently in use are only a simple thin
wrapper over the library they're wrapping and exposes a lot of the
design considerations of the language that the toolkit was originally
written in. Yes, even Tkinter that comes with the standard lib is a hack
on top of python and looks much more Tcl-ish than pythonic.

I have always had the idea of writing a windowing toolkit wrapper that
creatively uses python features for maximum expressiveness (e.g.
decorator, with-statement, for-each), but never got the time to write
anything like that.



More information about the Python-list mailing list