What GUI toolkit looks the best?

A

Andrew Barilla

I'm working on a cross platform app which has a standard GUI front end
for administration and a kiosk front end for user usage. I'm using
wxWindows for the standard GUI and it does port between Windows and
Linux without a problem. The only significant difference I've seen is
that MDI applications in Linux don't look like the do in Windows.
Each child window shows up maximized in the parent window and there
are tabs across the top to switch between children. This just maybe
the default format and can be changed, but I haven't looked into it
yet.

For the kiosk I'm using PyGame which ports between Windows and Linux
just as well.

Andrew Barilla
http://www.exit66.com/
 
B

Brian Kelley

Edward said:
I have a lot of experience with both wxPython and Tkinter. I would urge
caution regarding any quick judgments. All cross-platform toolkits have
significant bugs and design flaws.

My experience is that Tkinter is the "least bad" and more flexible.
wxPython (of course) inherits all the _many_ bugs in wxWindows. It's not
clear that wxWindows really actually works. Whenever I use
wxPython/wxWindows I find more bugs in a week than I have found in 3+ years
with Tk/Tkinter. YMMV. The (admittedly very cool) wxPython demo regularly
segfaults on Windows. Sheesh.

That's very interesting. I've never had the wxPython demos segfault on
windows, and I use it regularly (2 years) to examine various widgets. I
wonder if your setup or mine is the "special case" :)
The main point is that some real experimentation (and risk!) is going to be
required for any significant project. You may as well budget some time for
frustration: it _is_ going to be there.

Absolutely. The main attraction for me was wxWindows grid widget. I
use it to browser databases with 1,000,000+ entries.
Just one example of what you might expect. My app uses a Text widget in
many non-trivial ways. Both Tkinter/Tk and wxPython/wxWindows have
seemingly minor, but actually _major_ problems with Text widgets.

I hate wxPython's text widget for most of the reasons you described.
Plus, since we are using python, why isn't there a .write(...) method
for these widgets? Why can't I use a text widget like:

sys.stdout = TextCtrl(parent)

I had to make a wrapper around the text widget to make it behave like a
StringIO() class. It internally did all the necessary conversions to
the strings, but now I can use

widget.write()
widget.read()
widget.readlines()
widget.seek()

for line in widget:
pass

And the bastardication
print >> widget, file.read()

as if it were a real file object.

The interface to formatted text was a pain though. I still don't have a
good way of greating formatting except to say that it is in parallel
with the text stream.

Brian
 
B

Brian Kelley

Cameron said:
I want to say a few words about portability and comparisons.

I'm very reluctant to advise "see what you like the best" in regard to
GUI toolkits
<URL: http://www.informit.com/content/ind...ion_id={65C794A2-51C8-4FD3-8BD8-22F70A0695E0} >
the way I do for high-level languages. We all know it's entirely
realistic to counsel a newcomer, "Give yourself an hour, and you can
download and install Python (or Perl, or Ruby, or ...) and try it out
for yourself. You'll get a good first impression of how the language
operates."

That's not quite what I meant. The first step (for me) is finding out
what the toolkit supports. For example, tcl/Tk doesn't have a good grid
widget out of the box so for my project it was a non-starter which left
Qt, wxPython and GTK+
<URL: http://www.scriptics.com/ > isn't the URL I recommend; Scriptics
stopped doing business under that name three and a half years ago. <URL:
http://wiki.tcl.tk/tk > is a safe choice.

I would recommend http://www.tcl.tk/ actually which points to the same
place as http://www.scriptics.com/

Brian
 
E

Edward K. Ream

My experience is that Tkinter is the "least bad" and more flexible.
Isn't that last sentence a bit overly FUD-ish?

Umm. Maybe you are right.

My main point, and I think it is important, is that wxWindows seems
significantly flakier than Tk. Much more than Tk, the wxWindows experience
is "design once, debug everywhere".

Edward
 
O

Oren Tirosh

What's wrong with Jython? I haven't used it myself, but have always wondered
why it's not mentioned when different Python GUI:s are discussed.

Jython + SWT is a pretty cool combination. SWT is a well-designed, high
performance portable toolkit using native widgets. Python is our favorite
language. If they could be married without Java it would be even better.

Oren
 
P

Peter Hansen

Brian said:
I hate wxPython's text widget for most of the reasons you described.
Plus, since we are using python, why isn't there a .write(...) method
for these widgets? Why can't I use a text widget like:

sys.stdout = TextCtrl(parent)

I had to make a wrapper around the text widget to make it behave like a
StringIO() class. It internally did all the necessary conversions to
the strings, but now I can use ...

Probably the reason the text widget doesn't already do those things is
that nobody has taken the time to make it happen *and* release the changes
back to the project. Is Robin Dunn supposed to think of and write all
these things himself, just for your benefit?

-Peter
 
B

Brian Kelley

Peter said:
Probably the reason the text widget doesn't already do those things is
that nobody has taken the time to make it happen *and* release the changes
back to the project. Is Robin Dunn supposed to think of and write all
these things himself, just for your benefit?

That's a bit rough considering I give back quite a bit to the wxPython
community. Most of the useful things that I have written I have given
back to wxPython. A short resume includes PyGTK/Glade tutorial and Dr.
Dobbs article, WizardTransitionPages, grid_MegaExample, etc. Some made
it into the distribution, some didn't.

I don't even know if this is a sane interface. When I said "why isn't
there a .write(...) method for these widgets? Why can't I use a text
widget like<a file stream>" that wasn't a specious Robin should do this
for me question. It really was more like, is this a way a text widget
should behave?

I also wan't just talking about wxPython, non-pythonic behavior exists
across the board wxPython/Tk/Qt/Gtk. Is it worth the effort to make a
text widget behave like a file stream, I'm not sure. I'm certainly not
going to force this down someone's throat, but when I'm happy with it
I'll release it.

Andrew Dalke wrote a good piece in the Dr. Dobb's 25th anniversary
article about the pythonification of C toolkits that I think is pretty
good reference for these types of discussions.

Brian
 
M

Max Slimmer

I have been using wxPython and it performs well ... You should also look
at Boa Constructor a GUI designer generates decent Python code,
integrated debugger is cool, shows local varraibles... for some uses I
find it better than winpython.
 
M

Max Slimmer

I have been using wxPython and it performs well ... You should also look
at Boa Constructor a GUI designer generates decent Python code,
integrated debugger is cool, shows local varraibles... for some uses I
find it better than winpython.
 
M

Max Slimmer

I have been using wxPython and it performs well ... You should also look
at Boa Constructor a GUI designer generates decent Python code,
integrated debugger is cool, shows local varraibles... for some uses I
find it better than winpython.
 
J

Jon Franz

What's wrong with Jython? I haven't used it myself, but have always
wondered
Jython + SWT is a pretty cool combination. SWT is a well-designed, high
performance portable toolkit using native widgets. Python is our favorite
language. If they could be married without Java it would be even better.

Oren

I use jython + java swing for a large, ongoing contract. The plugable look
& feels allow you to add some nice UI skins to your application with 1 or
two lines of code - I use the 'Alloy' look and feel from incors
(http://www.incors.com/lookandfeel/index.php) - though it does cost.

One nice thing with swing (and forgive me if SWT does this, I am not
familiar with it) is that most widgets will allow html to be used within the
text for simple markup - allowing for easy display of formatted paragraphs,
bold text, etc. It also comes in handy when you want to throw an image onto
a label widget.

You can use sun's one-studio (netbeans) to design your gui, and then use the
classes it generates within your jython code fairly easily. I find myself
creating quick and dirty forms all the time by hand in jython (its just so
fast - so few lines of code), but I am convert a lot of them to actual java
classes later for increased speed.

I'm off to look into SWT...

~Jon Franz
NeuroKode Labs, LLC
513.260.5788
 
B

Bruno Desthuilliers

Paul said:
(snip)


Is wxPython Windows specific? I guess it is,

You lose.
but can I port the
screen layouts to some comparable Linux toolkit or anything like that?
The screen shots for it do look really nice.

Perhaps because it uses 'native' (ie : Gtk+, Motif, Windows native or
MacOS X native) toolkits ?-)
Oh wow, yes I guess it's cross platform then.

You win !-)
Hmm, what Micro$oft
tool do I need to build and run it? Is Visual C++ enough?
Yeps. Or bcc, or mingw, or...
I guess
I can get the client to pay

Why ? It's free (as in free beer and free speech)
for some stuff like that. Also, is there
a Glade-like drag and drop gui editor for it?
wxGlade.

And also boa, PythonCard...
I don't know what I can really tell from these without more experience
with them. In particular, which is the most solid and reliable across
a wide range of Windows versions (95, 98, ..., XP whatever)? That
matters too.

Can't tell you about that (I used wxWindows on win98 and NT4ws and
Linux/Gtk+, without any trouble but as in any non-trivial code, there
are bugs... no more no less than in MFC or Borland toolkits)

Bruno
 
P

Paul Rubin

Bruno Desthuilliers said:
Why ? It's free (as in free beer and free speech)

I mean for the build tools (Visual C++ or whatever). I can't really
use the WxWindows source code without a way to compile it. I'm getting
discouraged to hear that WxWindows itself has numerous bugs though.
 
B

Brian Kelley

Paul said:
I mean for the build tools (Visual C++ or whatever). I can't really
use the WxWindows source code without a way to compile it. I'm getting
discouraged to hear that WxWindows itself has numerous bugs though.

I think that these might be a bit overblown. I have released some
medium-scale academic research packages to beta-testers using wxPython
and have had no problems so far. There are about 150 installations so
far at ten different sites. I have had more problems with different
installation styles of microsoft excel than I have had with supporting
wxPython bugs. Your mileage may vary however, and I certainly don't use
all the widgets (read textctrl).

The largest hurdles are with differences between windows/linux and mac,
but I have experienced similar differences with Tkinter. Not for the
GUI itself but with dealing with the clipboard etc. You may get
different behavior on different platforms so debugging on those
platforms is a must. I've been luck so far and the documentation is
pretty good.

I have seen wxPython crashes during development but they all have to do
with errors in the constructors of subclassed widgets. If you raise an
exception in a constructor before calling the baseclass' __init__
function wxPython get's very unhappy and dies miserably taking
everything down. Two solutions/workarounds are

1) always call the subclassed constructor first
2) use a try...except block where call the base __init__ with default
arguments and raise an event that will close down the app nicely.

I haven't been able to figure out a way to do this automatically on
constructor errors yet. If I could I would submit it to wxPython.

If you are running on windows or redhat linux, you won't need to build
wxPython/wxWindows, you can just download and install the binaries.

If you want to build wxPython/wxWindows by yourself you will just need
Visual C++.

Brian
 
B

Bruno Desthuilliers

Paul said:
I mean for the build tools (Visual C++ or whatever). I can't really
use the WxWindows source code without a way to compile it.

You can build wxWindows with the free (as in free beer) Borland's bcc5.x
compiler, or with free (as in free beer and free speech) compilers like
Minwg's gcc.
I'm getting
discouraged to hear that WxWindows itself has numerous bugs though.

I did not used wxWindows intensively, but I never had a crash in three
years. I couldn't say the same about apps written with MS VisualBasic or
like :(.

Every non-trivial code does have bugs. Python has bugs, gcc has bugs,
not talking about msvc. I think that some posts in this thread were a
bit of a special case (FUD or bad experience, I can't tell...)

wxWindows has 11 years of existence, and bindings exists for more and
more languages (Javascript, Python, Perl, haskell, lua, Ruby, Eiffel,
and even Java and C#...). I don't think so many developers would spend
personnal time writing bindings to a 'that much buggy' toolkit !-)

Bruno
 
H

Hans Nowak

Brian said:
I hate wxPython's text widget for most of the reasons you described.
Plus, since we are using python, why isn't there a .write(...) method
for these widgets? Why can't I use a text widget like:

sys.stdout = TextCtrl(parent)

The Wax TextBox (which is based on wxTextCtrl) has had a write() method for a
while, for exactly this purpose.

(http://zephyrfalcon.org/labs/, look for Wax)
I had to make a wrapper around the text widget to make it behave like a
StringIO() class. It internally did all the necessary conversions to
the strings, but now I can use

widget.write()
widget.read()
widget.readlines()
widget.seek()

for line in widget:
pass

The TextBox control doesn't have the other methods, mostly because I've never
felt the need to do these things. :) The iterator idea is interesting, though.
 
J

Jamey Cribbs

Paul said:
I've been approached about writing a Windows app which will need a
really professional looking GUI. Forget TKinter, this has to actually
look good (real artists will be available to get the visual stuff
right). Assuming I write in Python, what's the best toolkit to use?

Wow! What a response this question has generated. I would have to throw
my hat into the PyGTK ring, for both objective and subjective reasons.

I think GTK looks great on Windows and my PyGTK apps have been very
stable and responsive. On a more subjective note, for me, the PyGTK API
just fits my brain better than the wxPython one does. It just feels
more seemless to me and things make more sense when I look at them.
Like I said, pretty subjective.

Maybe you could write a small sample app using both PyGTK and wxPython
and see which one feels right to you.

Jamey
 
E

Edward K. Ream

It's not clear that wxWindows really actually works.
Umm. Maybe you are right.

After sleeping on this question, I think not :) True, my choice of words
wasn't the best, but since you brought up FUD, I'm willing to discuss my
fears, uncertainties and doubts about wxWindows.

Motivation & experience

The typical FUD campaign is driven by ulterior motives. I have no such
motives--I am not the author of a product that competes with wxPython or
Tkinter: I am a somewhat frustrated user of both products. Leo is about to
come a rare beast: a gui-agnostic application. That is, Leo will soon be
able to support other gui toolkits besides tkinter. Indeed, an experimental
wxPython plugin already exists. This plugin replaces Leo's default tkinter
gui with a wxPython gui. My remarks are based on experiences with a failed
wxWindows project and the present wxPython plugin.

Psychological responses

In my case, I do have doubts that I can make wxPython projects as solid as
the equivalent Tkinter projects. Related feelings include fear and
uncertainty, and some others ;-) These feelings are real, and they are based
on substantial experience.

Objective responses

In my experience, it is a _fact_ that wxPython (really wxWindows) seems to
have many more bugs than Tkinter. It is a _rare_ bug that has no
workaround, so this fact does _not_ mean that it is impossible to produce
"working" apps with wxWindows/wxPython. What is probably _does_ mean is
that it will be more expensive to create a solid wxPython app than one would
hope. In my experience, the answer to the question "Why the hell hasn't
wxPython become the standard GUI for Python yet?" is: "wxWindows is buggy."

Conclusions

All my comments have been intended to alert people to the complexities and
difficulties in choosing one gui or another. I wish that Tkinter and
wxPython were better, and I think people should have their eyes open when
considering using these tools.

Edward
 
P

Peter Hansen

Paul said:
I'm getting
discouraged to hear that WxWindows itself has numerous bugs though.

Paul, that's a load of FUD, as someone else said. While I'm sure
it's not bug-free, it does *not* in general crash as frequently
as Edward suggested. In fact, I'm pretty sure there are hundreds of
people using it successfully (and quietly) for every time it has crashed
for him. I'd suggest he investigate his own machine's stability rather
than pointing the figure solely at wxPython. From my own experience,
it has *never* crashed in that manner, including after using the demo
extensively (i.e. trying out effectively *all* the included demos),
except with one that involved some DirectX or OpenGL stuff that wasn't
installed on my machine.

We haven't used it for really large apps, but we have a half dozen
smaller apps that are in relatively frequent use and so far no bug
reports of mysterious crashes.

Please don't let one person's experience spoil you on the idea of
at least investigating wxPython for your own use.

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,592
Members
45,104
Latest member
LesliVqm09
Top