[GRASS-dev] Python GUI toolkits
Glynn Clements
glynn at gclements.plus.com
Fri Jun 9 02:39:50 EDT 2006
Michael Barton wrote:
> > wxPython uses wxWidgets, which uses the platform's native widgets.
> > This provides a more native look-and-feel, but is harder to code for,
> > as there tend to be subtle differences between the behaviour of
> > similar widgets on different platforms.
>
> Does this mean that a scrolling tree widget, for example, that I coded in
> wxPython (using my Mac as a development machine with the installation of
> wxWidgets that comes with wxPython) might not work properly in Linux? Or
> that it might not 'look' the same?
Well, I wouldn't expect it to look the same; the whole point of using
native widgets is that they look like other applications on the same
platform, not like the same application on other platforms.
So far as working "correctly" is concerned:
If you only use "basic" functionality, then it will probably work on
all platforms, although the widget will probably behave differently on
different platforms, e.g. if you collapse then expand a node, whether
the collapsed/expanded state of its children is remembered, etc.
If you use more advanced functionality, you might have to to have the
Python equivalent of "#ifdef LINUX" etc. Some functionality might only
be available on certain platforms, e.g. whether you can sort a table
by multiple keys, whether the user can re-order columns, etc.
Generally speaking, the more complex the widget, the greater the
differences between equivalent widgets on a particular platform. At
one extreme are complex dialogs like file or colour selectors,
followed by tree and table widgets. At the other extreme, labels and
push-buttons tend to be fairly standard.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list