[Python-3000] Requirements for a standard GUI library

Robert Kern robert.kern at gmail.com
Wed May 10 23:44:57 CEST 2006


Travis E. Oliphant wrote:
> Greg Ewing wrote:
> 
>>Travis E. Oliphant wrote:
>>
>>>Just get a 
>>>window-area from each platform's lowest-level tool and then draw your 
>>>widgets to the screen directly.
>>
>>But then you have something that looks totally non-native
>>on all platforms. While it may be useful to have such a thing,
>>it's not what PyGUI is designed to be.
> 
> Sure, I understand that.  With appropriate theming, though it could be 
> made to look "native"  -- that's what Enthought is doing..

We only do that when we have to, i.e. when wxWidgets isn't up to the task. We
try to avoid it if we can. The amount of effort to make custom-drawn widgets
look "native" on each of the Big Three is large, so we end up doing it somewhat
incompletely preferring to satisfy our customers' desires. None of our tools
look very native on the Mac. Fortunately, our customers are used to scientific
apps that look much worse than ours.

We also embed native (well, wx) widgets like scrollbars into our Enable canvases
for the things that we *have* to draw ourselves, like plots.

>>>I suspect you could start by just interfacing with the 
>>>"platform-default" toolkits MFC, Cocoa, Gnome, and KDE (using ctypes for 
>>>example) and then using an approach similar to PyGUI to wrap them all up 
>>>using standard calls.
>>
>>Um... how would that be different from PyGUI itself?
> 
> Not much different at all except in breadth.  I like the idea of PyGUI 
> (it doesn't cover all backends, yet though).   Sorry I wasn't more 
> clear.  The only thing I would wish different is to get rid of the PyGTK 
> dependency.   I think PyGUI should be a wrapper directly on top of GNOME 
> because the only reason not to go down to raw X11 is for look-and-feel. 
>   Thus, PyGUI should go to the GNOME libraries and wrap them directly 
> instead of using another Python layer that wraps it.  Then another PyGUI 
> backend would wrap the KDE libraries directly for its look and feel (but 
> the same PyGUI paradigm).

Unfortunately, that approach duplicates a tremendous amount of effort that was
put into the wrappers in the first place. Wrapper on top of wrapper may feel
icky, but the effort shouldn't be duplicated without demonstrable benefits like
responsiveness. It seems to me that this might be done piecemeal, one widget at
a time.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco



More information about the Python-3000 mailing list