[wxPython] Anygui and wxPython

In the project(s) on which I have been working, I have made a
substantial investment in the use of wxPython, and I have no reason
to second guess that decision. IOW I have been (and still am) quite
happy with wxPython.

In principle, however, I also agree wholeheartedly with the
motivations and goals of the Anygui project. Were it not for the
following warning in the Anygui reference manual, I would strongly
consider adopting the Anygui API.

  The Anygui API is currently very much in flux as
  the Anygui team keeps experimenting with it.
  Because of that, incompatibilities may occur
  between releases. The current release (0.2)
  should be regarded as a prototype.

(not to mention the fact that the "current" release is actually
0.1.1).

My questions for the wxPython enthusiasts who are involved with the
Anygui project are these:

1. If I am basically happy with wxPython, should I even be looking
at Anygui (either now or down the road)?

2. When is the Anygui API likely to be stable enough to be "safe"
for production code?

3. In the meantime, is there a particular way of using wxPython
that will make the resulting code more compatible with the Anygui
API in the long run?

4. What can someone like me (Python coder only, no C skills) do to
support the Anygui project while continuing to use and support
wxPython?

···

=====
Donnal Walter
Arkansas Children's Hospital

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

[Donnal Walter]

In the project(s) on which I have been working, I have made a
substantial investment in the use of wxPython, and I have no reason
to second guess that decision. IOW I have been (and still am) quite
happy with wxPython.

Good. And from previous posts you have made I gather your wxPython apps are
fairly complex.

In principle, however, I also agree wholeheartedly with the
motivations and goals of the Anygui project. Were it not for the
following warning in the Anygui reference manual, I would strongly
consider adopting the Anygui API.

> The Anygui API is currently very much in flux as
> the Anygui team keeps experimenting with it.
> Because of that, incompatibilities may occur
> between releases. The current release (0.2)
> should be regarded as a prototype.

(not to mention the fact that the "current" release is actually
0.1.1).

Yes. I would think it is a bit early to consider adopting the anygui API for
a non-trivial, production application. But not too early to get familiar
with anygui.

My questions for the wxPython enthusiasts who are involved with the
Anygui project are these:

1. If I am basically happy with wxPython, should I even be looking
at Anygui (either now or down the road)?

Sure. But don't think of it as an immediate replacement for your existing
wxPython code.

2. When is the Anygui API likely to be stable enough to be "safe"
for production code?

I would not want to make any predictions of this kind, except to say "not
yet".

3. In the meantime, is there a particular way of using wxPython
that will make the resulting code more compatible with the Anygui
API in the long run?

Hard to say, but I rather doubt it. I haven't spent as much time helping
with anygui as I would like, but from what I do know nothing jumps out at
me. Perhaps the other anygui folks might have a suggestion.

4. What can someone like me (Python coder only, no C skills) do to
support the Anygui project while continuing to use and support
wxPython?

Plenty. And no C skills are required. I would get anygui from CVS, read all
the docs, join the email list (which has been pretty quiet lately) and use
anygui on a simple app as an experiment. That should give you an idea how
and where you might be able to contribute.

P.S. I hope you don't mind that I copied my reply to the anygui list.

···

--
Patrick K. O'Brien
Orbtech
-----------------------------------------------
"Your source for Python software development."
-----------------------------------------------
Web: http://www.orbtech.com/web/pobrien/
Blog: http://www.orbtech.com/blog/pobrien/
Wiki: http://www.orbtech.com/wiki/PatrickOBrien
-----------------------------------------------

Donnal Walter wrote:

In principle, however, I also agree wholeheartedly with the
motivations and goals of the Anygui project.

Now that you have brought this up, I have to ask...Why?

From the anyGUI web page:

The purpose of the Anygui project is to create an easy-to-use, simple,
and generic module for making graphical user interfaces in Python. Its
main feature is that it works transparently with many different GUI
packages on most platforms.

This sounds nifty, but...

I can think of a few reasons why one would choose a particular GUI
toolkit:

A) You like the API
B) It has the features you need
C) It works on the platforms you need to use it on
D) Others like licensing, etc. (I'm going to ignore this at the moment)

As far as I can tell, what anyGUI is doing is trying to provide a nice
API that will work with a variety of back ends, but why would you want a
variety of back ends? People use different toolkits for the above
reasons, so:

A) is negated, you are using hte anyGUI api, so you don't care about the
API of the underlying toolkit.

B) is also negated, you have the feature set of anyGUI. However, anyGUI
is by design going to have to be a lowest common denominator feature
set, or re-write a bunch of widgets in a bunch of tookits..anyone what
to re-write the tkCanvas in wxPython, PyQT, JAVA Swing, FLTK, etc,
etc....(and the wxGrid in all the other toolkits?) And what language
will you re-write it in? If you write it in Python, you will probably
have perfomance problems, if you write in C-C++, you have a whole lot of
work to do!

C) this is important, as you might get more platform options, but what
this means is that on some platforms you are going to have a whole lot
of layers:

AnyGui->wxPython->GTK->Xlib

As a matter of fact, the AnyGUI wxPython port seems the oddest to me: if
you can have anyGUI wrap Win32 and GTK (and presumably Motif and Mac if
you really wanted) what's the point of wxPython?

Why this bugs me is that I, too, would really like a GUI toolkit that is
powerfull, flexible, has a nice Pythonic API, and works on lots and lots
of platforms...I just don't see anyGUI as the way to get there. In fact,
wxPython is most of these already, and if the effort put into anyGUI
were put into wxPython, we could have all that so much sooner.

If people wanted an API for wxPython that is more Pythonic (and this
would be a good thing), you could write a thicker set of wrappers: it
would be less work than anyGUI. In fact, I suppose that is what the
PythonCard project is already doing.

If you want a widget (like TK's canvas) that wxPython doesn't have, you
can write it in wxPython, or write it in C++ wxWindows, it will still be
less work than writing it in a whole slew of toolkits.

Another real advantage of wxPython is that wxWindows is wrapping the
various native toolkits at the C++ level, which should make for better
performance in various ways, and most of it has been done for a number
of platforms already.

I just don't see what is gained by anyGUI; maybe someone can enlighten
me!

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

[Chris Barker]

Donnal Walter wrote:

> In principle, however, I also agree wholeheartedly with the
> motivations and goals of the Anygui project.

Now that you have brought this up, I have to ask...Why?

[lots of good points snipped]

Why this bugs me is that I, too, would really like a GUI toolkit that is
powerfull, flexible, has a nice Pythonic API, and works on lots and lots
of platforms...I just don't see anyGUI as the way to get there. In fact,
wxPython is most of these already, and if the effort put into anyGUI
were put into wxPython, we could have all that so much sooner.

If people wanted an API for wxPython that is more Pythonic (and this
would be a good thing), you could write a thicker set of wrappers: it
would be less work than anyGUI. In fact, I suppose that is what the
PythonCard project is already doing.

And that's why I spend most of my free time working on PythonCard. <wink> If
anyone is planning on going to the O'Reilly Open Source Convention you can
hear Kevin Altis and I do a presentation on PythonCard and PyCrust. See the
details here:

http://www.orbtech.com/web/pobrien/speaking

···

--
Patrick K. O'Brien
Orbtech
-----------------------------------------------
"Your source for Python software development."
-----------------------------------------------
Web: http://www.orbtech.com/web/pobrien/
Blog: http://www.orbtech.com/blog/pobrien/
Wiki: http://www.orbtech.com/wiki/PatrickOBrien
-----------------------------------------------

If people wanted an API for wxPython that is more Pythonic (and
this would be a good thing), you could write a thicker set of
wrappers: it would be less work than anyGUI.

Right, I can see that. In fact the reason that I started looking at
Anygui in the first place is that I found myself writing my own set
of wrappers around certain wxPython classes, with an API more to my
liking. Rather than completely reinventing the wheel, however, I
thought maybe the Anygui approach would be a fit. So in a way I'd
have to say I am more interested in the Anygui API than in the
Anygui code.

In fact, I suppose that is what the PythonCard project is
already doing.

Yes, I really should take some time to explore PythonCard. I
suppose the reason I have not done so already is that I know
nothing at all about HyperCard.

···

--- Chris Barker <Chris.Barker@noaa.gov> wrote:

=====
Donnal Walter
Arkansas Children's Hospital

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

[Donnal Walter]

> In fact, I suppose that is what the PythonCard project is
> already doing.

Yes, I really should take some time to explore PythonCard. I
suppose the reason I have not done so already is that I know
nothing at all about HyperCard.

Neither do half the PythonCard developers, including me. So don't let that
scare you away. HyperCard is merely an inspiration for some of the team and
we are in the process of dropping most of the HyperCardisms that snuck in
early on. The real idea behind PythonCard is to provide more structure over
wxPython to make things easier and more flexible. At the same time, all the
PythonCard stuff can easily be bypassed so you still have full access to
wxPython whenever you want. I'd love to see if some of your work could be
applied to PythonCard.

···

--
Patrick K. O'Brien
Orbtech
-----------------------------------------------
"Your source for Python software development."
-----------------------------------------------
Web: http://www.orbtech.com/web/pobrien/
Blog: http://www.orbtech.com/blog/pobrien/
Wiki: http://www.orbtech.com/wiki/PatrickOBrien
-----------------------------------------------

From: Donnal Walter

> In fact, I suppose that is what the PythonCard project is
> already doing.

Yes, I really should take some time to explore PythonCard. I
suppose the reason I have not done so already is that I know
nothing at all about HyperCard.

Well, for better or worse, the name isn't going to change, but PythonCard is
not HyperCard. If it helps, just think of PythonCard as a simpler way of
doing wxPython programs with a whole lot of samples and tools already in
place for you to copy and subclass and tools to help you build
cross-platform applications. You should be able to leverage a lot of your
wxPython knowledge with PythonCard; in general we're not trying to be
different except where there is a real benefit above what wxPython already
provides.

If there are particular parts of wxPython you would like to see simplified
or made "more Pythonic", besides bringing them up on this list
(wxPython-users) you can bring the topic up on the PythonCard list too.

ka

Chris Barker wrote:

As far as I can tell, what anyGUI is doing is trying to provide a
nice API that will work with a variety of back ends, but why would
you want a variety of back ends?

Because you want to do the best thing for your users? Somebody likes
KDE, somebody prefers GNOME and if you can give both camps your app
in native look & feel at no additional cost, well, that would be
great, wouldn't it? Especially when you are, say, developing
configuration utilities for your new Linux distribution...

BTW, wxWindows/wxPython's approach is very similar to anygui -- the
only difference is that we don't have multiple 'backends' per
platform (yet?). And, of course, since anygui is written in Python,
you can change the backend w/o recompilation. The biggest problem
with anygui is, as you pointed out, the lowest common denominator
one.

VS

This thing of "lowest common denominator" (LCD) is something I've been thinking about lately. I've been using wxPython exclusively for the past 2 years and I like it, but one of my colleagues thinks it is the wrong approach. His reasoning is that by using native toolkit the GUI ends up with the LCD, and the more platforms you support, the lower the LCD becomes. (For example, when the Mac version of wxPython gets launched it will probably start with a very low LCD.)

He thinks that non-native toolkit is the way to go because the toolkit is written once and it works the same on all platforms. You can achieve a certain look with themes.

Lately I've been thinking whether he might be right. Any thoughts on this???

Bob

···

At 04:35 PM 6/14/2002 -0700, you wrote:

Donnal Walter wrote:

B) is also negated, you have the feature set of anyGUI. However, anyGUI
is by design going to have to be a lowest common denominator feature
set, or re-write a bunch of widgets in a bunch of tookits...

[Bob Klimek]

This thing of "lowest common denominator" (LCD) is something I've been
thinking about lately. I've been using wxPython exclusively for
the past 2
years and I like it, but one of my colleagues thinks it is the wrong
approach. His reasoning is that by using native toolkit the GUI ends up
with the LCD, and the more platforms you support, the lower the LCD
becomes.

Great theory. Too bad nobody has been able to do it. Non-native GUIs never
look quite right and too many users judge a book by its cover. Unless your
users don't think the Scheme interface looks butt-ugly. <wink>

(For example, when the Mac version of wxPython gets launched it
will probably start with a very low LCD.)

I'm not a Mac person but the impression I'm getting from the Mac folks on
the PythonCard project is that most of the wxPython interface is there,
although there are bugs to work out. Even the Styled Text Control that is
used by the PyCrust shell and PythonCard code editor are now working on the
Mac.

He thinks that non-native toolkit is the way to go because the toolkit is
written once and it works the same on all platforms. You can achieve a
certain look with themes.

Great theory. Show me the toolkit that does this now? (And, yes, I know
there are some out there. But none is clearly superior to
wxPython/wxWindows.)

Lately I've been thinking whether he might be right. Any thoughts
on this???

I think you've made a good choice with wxPython, you're still happy after 2
years, and you've got a coworker who's thoughts (whether they are correct or
not in the abstract) have no concrete proof to back them up. So be happy.
:slight_smile:

···

--
Patrick K. O'Brien
Orbtech
-----------------------------------------------
"Your source for Python software development."
-----------------------------------------------
Web: http://www.orbtech.com/web/pobrien/
Blog: http://www.orbtech.com/blog/pobrien/
Wiki: http://www.orbtech.com/wiki/PatrickOBrien
-----------------------------------------------

Well, I guess I got a conversation going...

"Patrick K. O'Brien" wrote:

The real idea behind PythonCard is to provide more structure over
wxPython to make things easier and more flexible. At the same time, all the
PythonCard stuff can easily be bypassed so you still have full access to
wxPython whenever you want.

I got that impression from a lot of the posting here. I thin kit is
unfortunate that the HyperCard association is soo string, as that seems
to put people off from checking it out. It's time for me to give it a
serious look-see...

Kevin Altis wrote:

just think of PythonCard as a simpler way of
doing wxPython programs with a whole lot of samples and tools already in
place for you to copy and subclass and tools to help you build
cross-platform applications.

You might want to put more text like that on the PythonCard home page.

Vaclav Slavik wrote:

BTW, wxWindows/wxPython's approach is very similar to anygui -- the
only difference is that we don't have multiple 'backends' per
platform (yet?).

What about wxMotif?

That was one of my points...wxWindows already tries to do the same
thing. The real difference is that it is in C++, rather than Python, but
I think that is appropriate for stuff that really is pretty low level.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Bob Klimek wrote:

>B) is also negated, you have the feature set of anyGUI. However, anyGUI
>is by design going to have to be a lowest common denominator feature
>set, or re-write a bunch of widgets in a bunch of tookits...

This thing of "lowest common denominator" (LCD) is something I've been
thinking about lately. I've been using wxPython exclusively for the past 2
years and I like it, but one of my colleagues thinks it is the wrong
approach. His reasoning is that by using native toolkit the GUI ends up
with the LCD, and the more platforms you support, the lower the LCD
becomes.

Note that I wrote: "or re-write a bunch of widgets in a bunch of
toolkits". wxWindows works by writing any widget that is not supported
natively. This is a lot of work, and is low level enough that it is
probably best done in C++, rather than Python. anyGUI requires even more
of this work, because it aims to support even more back ends.

He thinks that non-native toolkit is the way to go because the toolkit is
written once and it works the same on all platforms. You can achieve a
certain look with themes.

Achieving a given look is hard enough, but achieving the native feel is
even harder.

None that wxWindows now has the "wxUniversal" port, which is essentially
what you are talking about... writing all the widgets in low-level code,
so you can have the best of both worlds with wxWindows!

http://www.wxwindows.org/wxuniv.htm

But
I'm a KDE user when on Linux, and the way they've implemented it is pretty
nice. Though I must say I haven't seen Qt on Windows yet so I can't say if
the Windows implementation would bother me, but the Windows theme on Linux
looks okay (though not perfect) to me.

I'm curious about that as well. How well does QT work on Windows? They
now have a MacOS port as well, so my group is currently trying to choose
between QT and wxWindows (there really aren't any other options for C++
and Python on Windows, MacOS and *nix are there?) If anyone has any
experience wioth QT, I'd love to here it.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I'd absolutely agree with the comments below. As much as I'm coming to
appreciate wxPython/python, the GUI implementation is fairly inflexible
because it is based on the underlying native tool kit. This list has heard my
beef's before about the lack of say non-3D tools, especially text boxes which
lead to 'heavy', 'clunky' screen designs.

Often when designing a GUI for an information intensive environment (here
read medicine (www.gnumed.net project). one has to cram an enormous amount of
information (read text usually) into a small amount of screen realestate.
With the heavyness of many of the underlying wigit designs on some platforms
the result contains much unwanted clutter. Also, it seems under md8.2 and
gtk that there is much wasted space in the height of lines in lists - where
using smaller fonts - the line size doesn't seem to downsize as much as it
could.

I could rave on but that's it for now. Part of this may be my lack of
understanding, however when I compare wxPython to QT I think the toolbox is
not as pleasant to use/on the eye, and QT I think has its own wigit set.

···

On Tuesday 18 June 2002 12:42 am, you wrote:

At 04:35 PM 6/14/2002 -0700, you wrote:
>Donnal Walter wrote:
>
>B) is also negated, you have the feature set of anyGUI. However, anyGUI
>is by design going to have to be a lowest common denominator feature
>set, or re-write a bunch of widgets in a bunch of tookits...

This thing of "lowest common denominator" (LCD) is something I've been
thinking about lately. I've been using wxPython exclusively for the past 2
years and I like it, but one of my colleagues thinks it is the wrong
approach. His reasoning is that by using native toolkit the GUI ends up
with the LCD, and the more platforms you support, the lower the LCD
becomes. (For example, when the Mac version of wxPython gets launched it
will probably start with a very low LCD.)

He thinks that non-native toolkit is the way to go because the toolkit is
written once and it works the same on all platforms. You can achieve a
certain look with themes.

Lately I've been thinking whether he might be right. Any thoughts on
this???

Bob

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

From: richard terry

I'd absolutely agree with the comments below. As much as I'm coming to
appreciate wxPython/python, the GUI implementation is fairly inflexible
because it is based on the underlying native tool kit. This list
has heard my
beef's before about the lack of say non-3D tools, especially text
boxes which
lead to 'heavy', 'clunky' screen designs.

Ah, but just because wxWindows/wxPython uses the underlying native toolkit
for the standard controls does not prevent you from overriding the
implementation or deriving your own. You can put together compound controls,
you can do your own displays with wxDCs, you can wrap ActiveX controls on
Windows, you can use SWIG to wrap a C++ control not already included in the
base library, you can still do whatever you want while still following the
wxWindows API. All that you might lose is the cross-platform aspect
depending on which design decisions you make, but again it is up to you. At
least you have an option.

Whether your users will be happy with a control you create that doesn't look
or behave like anything else they are used to using is a separate issue.

Another thing to consider is that wxWindows on Linux is currently working
off of GTK 1.x and certainly when GTK 2.x is the standard, then many of the
native controls which you might not like compared to their current KDE/Qt
counterparts, might be much better with 2.x.

The bottom line is that native widgets are a key selling point for
developers, but especially for users.

ka