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

Bill Janssen janssen at parc.com
Sun Apr 30 21:55:31 CEST 2006


I've looked over the PyGUI code a bit more carefully.

It still looks good to me as a Py3K standard portable GUI candidate.
In particular, it doesn't look like it would be hard to port to Java
Swing (for Jython) and Windows.Forms (for IronPython on .NET and
Mono).  Might make good summer projects...

A few things that need to be done (IMO):

1)  I'd add some kind of standard analog value control class, similar
    to Swing's JSlider or wxWidget's wxSlider or Cocoa's NSSlider.
    This can be implemented in pure Python (I've done it), but it's such a
    common widget in underlying toolkits that it should be possible to use
    that underlying widget when porting to a new widget platform.

2)  There needs to be some kind of combobox multiple-value choice
    widget other than RadioButtons, more like wxChoice or non-editable
    JComboBox.

3)  I'd implement (2) by slightly generalizing the Menu class, which
    would also allow them to be used for pop-up menus.

4)  The widget class hierarchy should probably be re-worked a bit to
    use more abstract mix-in classes.  For instance, the PyGUI Container
    class should probably be abstract (rather than inheriting from
    Component), and the View class should probably mix it in along with
    Component.  This would make it easier to implement new components
    in pure Python.  I think I see why the current implementation exists,
    because the toolkit dates from the pre-grand-type-unification days,
    but this should be spruced up.

5)  There should probably be a new class to permit rendering into a
    PDF stream, for printing. This could either be a new subclass of
    Canvas (probably would have to be), or share a common base class with
    Pixmap, which already exists.  Perhaps Pixmap should be a subclass of
    Canvas.  I'd need to look at more use cases.

An editable styled-text widget would be interesting, instead of the
simpler editable text widget that already exists.  It would put more
demands on the underlying widget platform, but at least four (GTK+,
Swing, Cocoa, wxWidgets) all support this kind of widget.

It would also be useful to have pure-Python implementations of all the
widgets, to make porting it to a new platform dirt simple.  Just port
the Canvas and Window (I think), and you already have working UIs.
Doesn't have to look great, at least to start out with.

By the way, I would not include the OpenGL widgets currently in PyGUI
into the standard GUI.  At least, not yet -- they are still clearly
being experimented with.  Down the road, I think it's a good idea --
every platform needs an OpenGL interface, and it makes sense to
integrate it with the standard GUI.

Bill
------------------------------------------
 Bill Janssen  <janssen at parc.com>     (650) 812-4763    FAX: (650) 812-4258
 PARC -- User Interface Research Area          http://www.parc.com/janssen/

    


More information about the Python-3000 mailing list