[Python-3000] PyGUI in Py3K stdlib, more details

Paul Moore p.f.moore at gmail.com
Tue May 2 14:07:48 CEST 2006


On 5/2/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Paul Moore wrote:
>
> > This is, of course, hard, as platforms offer widely differing widget
> > sets. Tough. Nobody said writing a portable GUI layer was going to be
> > easy.
>
> Indeed. I'd say this kind of issue has been the *most*
> difficult thing about designing and implementing PyGUI
> so far. One has to steer a tricky course between the
> features provided by the various platforms.

Exactly.

> This is also a reason for targeting the *smallest* set
> of platforms that one can get away with, lest the
> intersection of available features shrink to something
> so small as to be useless. That's why I'm currently
> planning to support exactly 3 platforms (Cocoa, Gtk
> and Win32), and would be reluctant to add any more that
> overlap with those.

An alternative is to expose more widgets, but make them only available
on platforms that have them natively. That pushes the platform
independence issues back to the application developer, but I'm not
sure this is unreasonable. Python has a tradition of exposing platform
differences (look at modules like curses, pty, _winreg, etc for
examples), so it's ann acceptable course for a library that strives to
be "Pythonic".

The minimal widget set (button, label, edit box) is common across all
platforms, so minimal applications will be fine. People writing larger
applications needing more complex UI elements need to know how to
address the differences, so a certain level of conditional code is OK.

And people (like me!) who only want to target one platform can use the
full range of widgets, and to heck with portability :-)

But it's still difficult, and you'll never please everyone.

> I suspect that attempting to support too many platforms
> is one of the things that led to anygui's demise.

And equally, to wxPython's size (to an extent).

Paul.


More information about the Python-3000 mailing list