wxPython vs other toolkits

Hello,

Have any of you tried other toolkits besides wxPython? Can anyone make a comparison? Keeping in mind that I don't have experience with other toolkits, I would venture the following points:

* Tkinter

Pros: Easy to use, well documented, easiest to deploy, mature, license.
Cons: Butt ugly.
Best for: Internal applications that don't have to look good.

* PyGtk

Pros: Easy to use, well documented, looks good on Linux, license.
Cons: Doesn't right on Windows and Mac.
Best for: Applications that target Linux.

* wxPython

Pros: Cross-platform, mature, not /too/ hard to use, license.
Cons: Less easy than PyGtk.
Best for: Cross-platform applications.

* PyGtk

Pros: Cross-platform, mature (ease of use??).
Cons: GPL - restrictive license.
Best for: Programs that you intend to make GPL; KDE programs.

Comments?

I decided to look at wxPython because I want to be able to write cross platform applications and not be restricted by the license. I'll probably make all my apps GPL anyways, but I want to have a choice, and I want something that I can use in a professional context where I don't have a choice over the license.

Cheers,
Daniel.

Hello,

Have any of you tried other toolkits besides wxPython? Can anyone make a
comparison? Keeping in mind that I don't have experience with other
toolkits, I would venture the following points:

* Tkinter

Pros: Easy to use, well documented, easiest to deploy, mature, license.
Cons: Butt ugly.
Best for: Internal applications that don't have to look good.

"ugly" is in the eye of the beholder, and in the talent of the UI
designer. While older Tk does look somewhat clunky on *nix systems, it
doesn't have to, plus it uses native widgets on the Mac and on
windows. With the "tile" extension or sufficiently modern underlying
version of Tk you can create very polished GUIs.

I think another pro is that Tk is incredibly well designed. Ask anyone
who understands Tk's event mechanism and wxPython's event mechanism,
and wxPython will appear to be about a decade behind in
sophistication. In fact, Tk's event mechanism is certainly the best
I've used (though I've only seriously used a half dozen or so for an
extended period of time)

Another pro is geometry management, where Tkinter wins hands down. You
can do almost any layout with the single grid geometry manager. For
simple layouts such as horizontal-only toolbars, or vertically stacked
regions of a UI, pack is remarkably powerful and easy. And when you
need precise placement you have place. Each is considerably easier to
use then the somewhat confusing sizers of wxPython (using place
definitely requires a little skill, but you rarely, if ever need it).
I think grid and pack are more beginner-friendly than mechanisms used
by other toolkits.

A con to Tkinter is that it is a wrapper around Tk, which means there
are widget objects which are mapped to the actual tk widgets. This can
be clunky at times.

I will agree that Tk's sweet spot is internal applications rather than
glossy commercial apps, but there are certainly some highly successful
commercial apps that are based on Tk (though on tcl/tk rather than
python/Tkinter).

I also think Tkinter is great for cross-platform applications. Many
times I've worked months on a program, then found myself on a
different architecture (switch jobs, computer breaks, on vacation,
etc) and the code simply works. Sometimes minor tweaks have to be made
but by and large cross-platform apps with Tkinter is a no-brainer.

* wxPython

Pros: Cross-platform, mature, not /too/ hard to use, license.
Cons: Less easy than PyGtk.
Best for: Cross-platform applications.

I think wxPython's documentation is pretty bad. There may be a large
quantity of machine-generated docs, but actually useful documentation
is hard to come by when you need anything more than basic information.
This is only an issue when learning; arguably, once you are an expert
it has little relevance to the usefulness of the toolkit.

wxPython's method of handling events can be maddening. And while it
does make a really good attempt at making it easy to do cross-platform
apps, that means you are sometimes limited by their definition of how
a platform behaves. If you want to create something unique it can be
quite a challenge.

A plus for wxPython is the myriad of widgets that are available. With
Tkinter you sometimes have to "roll your own". A downside of wxPython
is the myriad of widgets. Want a text widget with line numbers?
There's a widget for that. Want one with varying line heights/fonts?
There's a widget for that. What both? You're out of luck.

Another benefit wxPython has over Tkinter is eye candy -- you can do
some nifty gradient and alpha blending things with wxPython. If eye
candy is important, wxPython wins over Tkinter pretty handily.

···

On Sat, Jan 16, 2010 at 8:21 AM, Daniel Carrera <dcarrera@gmail.com> wrote:

Bryan Oakley wrote:

"ugly" is in the eye of the beholder, and in the talent of the UI
designer. While older Tk does look somewhat clunky on *nix systems, it
doesn't have to, plus it uses native widgets on the Mac and on
windows. With the "tile" extension or sufficiently modern underlying
version of Tk you can create very polished GUIs.

... [lots of great features] ...

Wow. I didn't know that Tk had so much going for it. Maybe I should take a closer look. Can I ask you more questions?

* Can you make Tk look native on Linux/Gnome? Is it hard?
* Is Tkinter hard to package with py2exe? Is the output large?

If you can share more about the pros and cons of Tkinter vs wxPython I would be immensely grateful.

I will agree that Tk's sweet spot is internal applications rather than
glossy commercial apps, but there are certainly some highly successful
commercial apps that are based on Tk (though on tcl/tk rather than
python/Tkinter).

Ok.

I think wxPython's documentation is pretty bad.

Given my recent struggles, I can't disagree.

wxPython's method of handling events can be maddening. And while it
does make a really good attempt at making it easy to do cross-platform
apps, that means you are sometimes limited by their definition of how
a platform behaves. If you want to create something unique it can be
quite a challenge.

Interesting.

A plus for wxPython is the myriad of widgets that are available. With
Tkinter you sometimes have to "roll your own". A downside of wxPython
is the myriad of widgets. Want a text widget with line numbers?
There's a widget for that. Want one with varying line heights/fonts?
There's a widget for that. What both? You're out of luck.

Ok. I'm thinking mostly of simple applications. Specifically, I want to write a dictionary application. I need two radio buttons, menus, a text entry field, a button, and a place to display search results. That's it.

Another benefit wxPython has over Tkinter is eye candy -- you can do
some nifty gradient and alpha blending things with wxPython. If eye
candy is important, wxPython wins over Tkinter pretty handily.

Nah. I have neither interest nor skill on eye-candy.

Thanks for the info. I learned a lot about Tkinter from your post. I realized that I've been ignoring a very worthy alternative.

Cheers,
Daniel.

Another benefit wxPython has over Tkinter is eye candy -- you can do
some nifty gradient...things with wxPython.

I've found working with gradients (like on panels, as a background) in
wxPython to be problematic, because depending on the widget and
platform, often the parts of the widget that should be "transparent"
and allow the background to come through don't do that, and instead
one sees some "system grey" (or whatever the background color of the
widget is set to) in those regions, and that looks ugly. (E.g.
regular buttons on windows, comboctrls on Linux, checkboxes on
windows, etc.). There are some tricks one can try that help (like
setting the background to be around the same value as the where the
widget is found). It's also been a little tricky with things like
SetCompositeMode on Windows, but Robin as usual has been a big help
there with explaining how to do that.

Of course, one can roll one's own widgets that don't have this issue;
in the ButtonPanel widget that Andrea Gavana made (see demo), he
mentions this and uses transparent PNG images to make his own buttons
that don't give this ugly effect on his gradient. But once you get
into that, the usefulness of a *ready-made* toolkit diminishes
somewhat (I am contemplating making my own checkboxes, comboctrls,
etc., and I wish I didn't have to since perfectly good ones exist
other than issue). It's too bad there isn't a way to make it such
that areas that are meant to be transparent and let whatever is behind
them "shine through" can't do that--but I think the limitation is in
the native widgets, not in wx code.

If eye candy is important, wxPython wins over Tkinter pretty handily.

All this said, I still feel one can make some quite nice looking GUIs
with wxPython and I keep trying to tweak things to do so, as I enjoy
the aesthetic challenge.

Che

C M wrote:

Another benefit wxPython has over Tkinter is eye candy -- you can do
some nifty gradient...things with wxPython.
    

Just to contribute some pros of wx (I've only used swing (java) and MFC/WPF or whatever in visual studio)

wx is powerful, no doubt. There has not been anything I've wanted to do that I can't due to a limitation of the toolkit. The functionality it provides is great: clipboard data, drag/drop, keyboard accelerators, "hotkeys", process management, filehistory, just these small things that really tie an application together. After a while of using it, I find it easy to simply code what I need - the API is consistent which makes picking up new widgets a breeze.

Then there's the masses of extra widgets/mixins available in the lib package. The documentation may be somewhat lacking but I've found a mixture of Google/archived mail lists/the list itself (especially Rob)/wxWidgets references allow to me to find out what I need.

···

--
Steven Sproat, BSc
http://www.basicrpg.com/

Hello,

Have any of you tried other toolkits besides wxPython? Can anyone make a comparison? Keeping in mind that I don’t have experience with other toolkits, I would venture the following points:

  • Tkinter

Pros: Easy to use, well documented, easiest to deploy, mature, license.

Cons: Butt ugly.

Best for: Internal applications that don’t have to look good.

I started with this. The documentation was annoying when I used it as it had lots of old cruft in it and said stuff that no longer applied. I don’t know if that’s been rectified or not. I seem to remember it had a lot of man pages just like wx does. From what I’ve read, it looks a lot better now. My main reason for switching was the lack of widgets that I needed and I didn’t have the time to figure out how to roll my own.

  • PyGtk

Pros: Easy to use, well documented, looks good on Linux, license.

Cons: Doesn’t right on Windows and Mac.

Best for: Applications that target Linux.

No comment since I couldn’t get it to install on Windows successfully.

  • wxPython

Pros: Cross-platform, mature, not /too/ hard to use, license.

Cons: Less easy than PyGtk.

Best for: Cross-platform applications.

Since I started out with C++, this one just clicked for me and I use it for all my GUI work.

  • PyGtk

Pros: Cross-platform, mature (ease of use??).

Cons: GPL - restrictive license.

Best for: Programs that you intend to make GPL; KDE programs.

Why did you list PyGtk twice? Is this supposed to be pyQT? The license may no longer be an issue since Nokia bought the people behind QT and open-sourced it. There’s also a new project called PySide that you might want to look at. There is no Windows support yet, so that’s a bummer. Here’s a link: http://www.pyside.org/

Comments?

I decided to look at wxPython because I want to be able to write cross platform applications and not be restricted by the license. I’ll probably make all my apps GPL anyways, but I want to have a choice, and I want something that I can use in a professional context where I don’t have a choice over the license.

Cheers,

Daniel.

All of the toolkits have pros and cons. I usually recommend giving a few of them a try and see which one makes the most sense to your mind. Then choose that one unless it’s lacking in some critical areas.

···

On Sat, Jan 16, 2010 at 8:21 AM, Daniel Carrera dcarrera@gmail.com wrote:


Mike Driscoll

Blog: http://blog.pythonlibrary.org

Mike Driscoll wrote:

    * PyGtk
...

No comment since I couldn't get it to install on Windows successfully.

That alone is a useful comment: "Not a good choice for cross-platform app".

    * wxPython
...

Since I started out with C++, this one just clicked for me and I use it for all my GUI work.

Ok. I don't know C++ and I'd rather not learn it (I do know C though, but I don't like to use it for anything but math).

    * PyGtk

    Pros: Cross-platform, mature (ease of use??).
    Cons: GPL - restrictive license.
    Best for: Programs that you intend to make GPL; KDE programs.

Why did you list PyGtk twice? Is this supposed to be pyQT?

OOOPS! Yes, I meant PyQt.

The license may no longer be an issue since Nokia bought the people behind QT and open-sourced it. There's also a new project called PySide that you might want to look at. There is no Windows support yet, so that's a bummer. Here's a link: http://www.pyside.org/

QT may be LGPL, but PyQt is GPL only. Nokia tried to get the maker of PyQt to make PyQt LGPL but they couldn't reach an agreement (the maker of PyQt makes money by selling commercial licenses). That's why Nokia started PySide, but it's still alpha.

All of the toolkits have pros and cons. I usually recommend giving a few of them a try and see which one makes the most sense to your mind. Then choose that one unless it's lacking in some critical areas.

I played with PyGtk and honestly I find it easier to use than wxPython, but I want something cross-platform, so I have to look elsewhere. I think I'll take another look at Tkinter. Based on CM's email, it looks like I dismissed it too easily.

I've tried Tkinter on Linux. At least here it looks ugly. :frowning:

Cheers,
Daniel.

I played with PyGtk and honestly I find it easier to use than wxPython, but
I want something cross-platform, so I have to look elsewhere. I think I'll
take another look at Tkinter. Based on CM's email, it looks like I dismissed
it too easily.

That was Bryan Oakley's email. I know nothing about Tkinter. :smiley:

CM (Che)

C M wrote:

That was Bryan Oakley's email. I know nothing about Tkinter. :smiley:

Sorry. :slight_smile:

Have any of you tried other toolkits besides wxPython? Can anyone make a comparison? Keeping in mind that I don’t have experience with other toolkits, I would venture the following points:

  • Tkinter

Pros: Easy to use, well documented, easiest to deploy, mature, license.

Cons: Butt ugly.

Best for: Internal applications that don’t have to look good.

It isn’t clear to me whether this is possible with Tkinter as well, but here is one example of a relatively slick Tcl/Tk GUI:

http://www.mrc-lmb.cam.ac.uk/harry/imosflm/ver103/

  • PyGtk

Pros: Easy to use, well documented, looks good on Linux, license.

Cons: Doesn’t right on Windows and Mac.

Best for: Applications that target Linux.

Agreed - Apple’s X11 server is an atrocity, and native Gtk on Mac appears to be dead.

  • wxPython

Pros: Cross-platform, mature, not /too/ hard to use, license.

Cons: Less easy than PyGtk.

Best for: Cross-platform applications.

Another consideration: it appears to have good support for other modules such as matplotlib, the Enthought tools, OpenGL - which may or may not matter to you, but it’s great for writing scientific apps. PyQt supports all of these too, however, some of them slightly better (e.g. antialiasing in OpenGL, which I’m told will finally be available in wx2.9).

Additional Con: cross-platform programming is still a hell of a lot harder than it sounds, because even though everything works more or less the same, simple things like different widget sizes, fonts (anyone know how to make an Angstrom symbol on Linux?), etc. can make it difficult to get the layout looking consistent. However, this was obviously going to be true for PyQt as well, unless we forced a Linux-like look on the Mac port.

Additional Con #2: I have found it very difficult to debug certain crashes, e.g. I have to be extremely careful about which dialogs I Destroy(), even when using wx.CallAfter(), if I don’t want my application to crash randomly. I eventually ended up not destroying most windows, which is more stable but occasionally leads to weird side effects and requires brute force to quit. Occasionally it gets stuck in an infinite loop responding to an event, and I haven’t been able to figure out what triggers this. Some of it is certainly my fault, but it’s inconsistent and difficult to reproduce, and impossible to tell what is breaking since the crashes are triggered by low-level C++ segfaults. (NB: just to be perfectly clear, this is wxWidgets’ fault, not wxPython’s.)

  • Py[Qt]

Pros: Cross-platform, mature (ease of use??).

Cons: GPL - restrictive license.

Best for: Programs that you intend to make GPL; KDE programs.

I, personally, didn’t really think the documentation was much better than wxPython’s, and I like Robin’s book better than the PyQt book. wxPython also has a good collection of custom widgets (the license has certainly helped with that). I did think PyQt would be an attractive platform for cross-platform programming - it doesn’t look exactly native on Mac, but much better than Gtk. There were a few things that actually appear to be more difficult, e.g. dynamically adding/removing widgets from windows and having the layout change cleanly, which I simply could not figure out in PyQt. (Perhaps I looked in the wrong place, but it should not have been that difficult.)

I decided to look at wxPython because I want to be able to write cross platform applications and not be restricted by the license. I’ll probably make all my apps GPL anyways, but I want to have a choice, and I want something that I can use in a professional context where I don’t have a choice over the license.

This was our reasoning too. When I started my job, I was asked to evaluate other toolkits and determine which we wanted to use; we already had some code (~4000 lines) in wxPython and in-house expertise, but PyQt looked like a good alternative. We support Mac and Linux exclusively, which made it easier. I thought PyQt was about as easy to program (except for the caveat above), but the license was a turn-off - all of our code is either BSD-ish or proprietary, and we didn’t like the idea of paying per developer. (The fee is not unreasonable, but enough to discourage us, anyway.)

Most of my code subclasses wxPython controls anyway, so outside of a few base modules, there are relatively few direct references to the wx module. So if we decided to switch at some point, it would probably be straightforward to swap in PyQt.

-Nat

···

On Sat, Jan 16, 2010 at 6:21 AM, Daniel Carrera dcarrera@gmail.com wrote:

Mike Driscoll wrote:

  • PyGtk

No comment since I couldn’t get it to install on Windows successfully.

That alone is a useful comment: “Not a good choice for cross-platform app”.

It just occurred to me that Wingware’s excellent Python editor is written in PyGtk (I think), and they have it running just fine on Windows (as well as *nix and Mac).

  • PyGtk

    Pros: Cross-platform, mature (ease of use??).

    Cons: GPL - restrictive license.

    Best for: Programs that you intend to make GPL; KDE programs.

Why did you list PyGtk twice? Is this supposed to be pyQT?

OOOPS! Yes, I meant PyQt.

The license may no longer be an issue since Nokia bought the people behind QT and open-sourced it. There’s also a new project called PySide that you might want to look at. There is no Windows support yet, so that’s a bummer. Here’s a link: http://www.pyside.org/

QT may be LGPL, but PyQt is GPL only. Nokia tried to get the maker of PyQt to make PyQt LGPL but they couldn’t reach an agreement (the maker of PyQt makes money by selling commercial licenses). That’s why Nokia started PySide, but it’s still alpha.

My bad…I thought PyQT was going to go by the way side from what I’d read.

···

On Sat, Jan 16, 2010 at 10:31 AM, Daniel Carrera dcarrera@gmail.com wrote:


Mike Driscoll

Blog: http://blog.pythonlibrary.org

It is PyGtk, but it is almost painful to use on Mac, and on Windows there are some issues as well if you look close enough.

···

On 1/16/10 9:38 AM, Mike Driscoll wrote:

On Sat, Jan 16, 2010 at 10:31 AM, Daniel Carrera <dcarrera@gmail.com > <mailto:dcarrera@gmail.com>> wrote:

    Mike Driscoll wrote:

            * PyGtk
        ...

        No comment since I couldn't get it to install on Windows
        successfully.

    That alone is a useful comment: "Not a good choice for
    cross-platform app".

It just occurred to me that Wingware's excellent Python editor is
written in PyGtk (I think), and they have it running just fine on
Windows (as well as *nix and Mac).

--
Robin Dunn
Software Craftsman
http://wxPython.org

Hello,

Have any of you tried other toolkits besides wxPython? Can anyone make a
comparison? Keeping in mind that I don't have experience with other
toolkits, I would venture the following points:

* Tkinter

Pros: Easy to use, well documented, easiest to deploy, mature, license.
Cons: Butt ugly.
Best for: Internal applications that don't have to look good.

Additional Con: For some people Tkinter just won't fit their brain no matter how hard they try. It just doesn't make sense. (Incidentally, that is why wxPython exists.)

* wxPython

Pros: Cross-platform, mature, not /too/ hard to use, license.
Cons: Less easy than PyGtk.
Best for: Cross-platform applications.

Additional Pro: Emphasis on using native widgets where ever possible, and providing generic alternatives when it is not. Non-native toolkits can get close to native LnF, but they never seem to get it 100%.

Additional Con: Using native widgets means that sometimes things work differently on different platforms, and so wxPython apps may need a little tweaking or conditionalizing to make them work on platforms that were not the primary development platform. There are some cases where if you do something slightly wrong it will still work okay on one platform but may break on the others.

Additional Con: Many of those for whom tkinter "fits their brain" will have troubles grokking wxPython. They seem to have difficulty understanding Python and it is very difficult for them to use it. It seems that for some it's an either/or situation and they can't do both.

···

On 1/16/10 6:21 AM, Daniel Carrera wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org

Regarding PyQt and it's license, a Nokia backed open source project,
PySide, will give us bindings under the LGPL

http://www.pyside.org/

- michael

Bryan Oakley wrote:

"ugly" is in the eye of the beholder, and in the talent of the UI
designer. While older Tk does look somewhat clunky on *nix systems, it
doesn't have to, plus it uses native widgets on the Mac and on
windows. With the "tile" extension or sufficiently modern underlying
version of Tk you can create very polished GUIs.

... [lots of great features] ...

Wow. I didn't know that Tk had so much going for it. Maybe I should take a
closer look. Can I ask you more questions?

* Can you make Tk look native on Linux/Gnome? Is it hard?

I don't believe there are gnome-specific looks for Tk, but I've been
out of the Tk loop for a couple years now and maybe something has
changed.

* Is Tkinter hard to package with py2exe? Is the output large?

I have no idea. I would assume the answer is "no", since Tkinter is
part of a standard python installation, unlike wxPython.

...

wxPython's method of handling events can be maddening. And while it
does make a really good attempt at making it easy to do cross-platform
apps, that means you are sometimes limited by their definition of how
a platform behaves. If you want to create something unique it can be
quite a challenge.

Interesting.

I should have pointed out in my earlier comments, this isn't wholly
unique to wxPython. For example, the Tkinter buttons on the mac have
some platform-specific limitations as well. The problem seems to me
to be worse with wxPython possibly because more widgets are native,
but that's just a gut feeling.

A plus for wxPython is the myriad of widgets that are available. With
Tkinter you sometimes have to "roll your own". A downside of wxPython
is the myriad of widgets. Want a text widget with line numbers?
There's a widget for that. Want one with varying line heights/fonts?
There's a widget for that. What both? You're out of luck.

Ok. I'm thinking mostly of simple applications. Specifically, I want to
write a dictionary application. I need two radio buttons, menus, a text
entry field, a button, and a place to display search results. That's it.

That would be quite easy with either wxPython or Tkinter. I personally
think it would be easier with Tkinter, but I have more experience with
Tk so I'm a bit biased. Either toolkit would suite that sort of
application just fine.

···

On Sat, Jan 16, 2010 at 9:51 AM, Daniel Carrera <dcarrera@gmail.com> wrote:

Robin Forgot one Pro and I will list it here:
Additional: You have creator of wxPython plus other makers (Like maker
of Andrea Gavana Widgets) and great people as you see.
That is greater enough to dump off TKinter.

I don't know why but I dismissed TkInter the time I tried it. I tried
wxPy and eureka! Bad documentation? Yes, but once you grasp the basics
it is all over. zetcode.com tutorials + Demo+Api+Wiki ----------->you
fly with wx
The Only thing that is real convoluted and haven't managed through is
printing framework. Haven't tried that though in others GUIs. The
PySide might be alternative to me if wxPython fails to go to py3k but
I don't think so.

Live long wxWidgets, live long wxPython :slight_smile:

···

On Jan 17, 12:19 am, Robin Dunn <ro...@alldunn.com> wrote:

On 1/16/10 6:21 AM, Daniel Carrera wrote:

> Hello,

> Have any of you tried other toolkits besides wxPython? Can anyone make a
> comparison? Keeping in mind that I don't have experience with other
> toolkits, I would venture the following points:

> * Tkinter

> Pros: Easy to use, well documented, easiest to deploy, mature, license.
> Cons: Butt ugly.
> Best for: Internal applications that don't have to look good.

Additional Con: For some people Tkinter just won't fit their brain no
matter how hard they try. It just doesn't make sense. (Incidentally,
that is why wxPython exists.)

> * wxPython

> Pros: Cross-platform, mature, not /too/ hard to use, license.
> Cons: Less easy than PyGtk.
> Best for: Cross-platform applications.

Additional Pro: Emphasis on using native widgets where ever possible,
and providing generic alternatives when it is not. Non-native toolkits
can get close to native LnF, but they never seem to get it 100%.

Additional Con: Using native widgets means that sometimes things work
differently on different platforms, and so wxPython apps may need a
little tweaking or conditionalizing to make them work on platforms that
were not the primary development platform. There are some cases where
if you do something slightly wrong it will still work okay on one
platform but may break on the others.

Additional Con: Many of those for whom tkinter "fits their brain" will
have troubles grokking wxPython. They seem to have difficulty
understanding Python and it is very difficult for them to use it. It
seems that for some it's an either/or situation and they can't do both.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

    * Tkinter
    Pros: Easy to use, well documented, easiest to deploy, mature, license.
    Cons: Butt ugly.
    Best for: Internal applications that don't have to look good.

Another couple pros: the Canvas and Text widgets.

but...

Bryan Oakley wrote:

I think another pro is that Tk is incredibly well designed.

It never felt that way to me.

Another pro is geometry management, where Tkinter wins hands down.

again, I guess it's a matter of taste:

pack is remarkably powerful and easy.

I found it to be quite painful for anything but the most basic of layouts. I had to keep adding a huge number of frames, just for layout.

Each is considerably easier to
use then the somewhat confusing sizers of wxPython

They do take a bit to wrap your brain around -- but I really like Sizers.

A con to Tkinter is that it is a wrapper around Tk, which means there
are widget objects which are mapped to the actual tk widgets. This can
be clunky at times.

It seems that the folks that really make Tk dance are digging into the TCL layer -- maybe that's OK, but I've never like TCL much either...

* wxPython

Pros: Cross-platform, mature, not /too/ hard to use, license.
Cons: Less easy than PyGtk.
Best for: Cross-platform applications.

license and true native look-and-feel are the major pros.

I think wxPython's documentation is pretty bad.

I don't know -- once I learned a bit about translating the C++ to Python, it's felt good to me - and the wxPython Demo is brilliant!

One more plus: the community is fantastic! (I don't know about he other communities)

A plus for wxPython is the myriad of widgets that are available. With
Tkinter you sometimes have to "roll your own".

Another MAJOR plus -- yes, you can do a lot with the Tk Text and Canvas widgets, but you still have to do it -- wx.Grid, wxSTC, wxHTML: major bonus!

    * PyGtk

    Pros: Easy to use, well documented, looks good on Linux, license.
    Cons: Doesn't right on Windows and Mac.
    Best for: Applications that target Linux.

Agreed - Apple's X11 server is an atrocity, and native Gtk on Mac appears to be dead.

too bad -- I don't have any problem with Apple's X11, but GTK apps look and act NOTHING like a Mac app -- I'm a linux geek, so it's OK by me, but many users will hate it. It's simply not an option at this point if you want to support the Mac well.

PyQt supports all of these too, however, some of them slightly better (e.g. antialiasing in OpenGL, which I'm told will finally be available in wx2.9).

huh? GL does it's own rendering -- wx doesn't have any influence on it whatsoever.

Additional Con: cross-platform programming is still a hell of a lot harder than it sounds, because even though everything works more or less the same, simple things like different widget sizes, fonts (anyone know how to make an Angstrom symbol on Linux?), etc. can make it difficult to get the layout looking consistent. However, this was obviously going to be true for PyQt as well, unless we forced a Linux-like look on the Mac port.

In fact, the Sizer approach is probably the best at dealing with this -- I've never had an issue, actually.

Additional Con #2: I have found it very difficult to debug certain crashes,

This can be a trick, though it's been a long time since I've ahd any issues.

I eventually ended up not destroying most windows, which is more stable but occasionally leads to weird side effects and requires brute force to quit.

hmmm -- this seems like an architecture issue, though I will agree that any crash of the interpreter is a bug.

    * Py[Qt]

License has kept this off the table for me, so I dont know much -- -a lot of folks really like it though.

    Pros: Cross-platform, mature (ease of use??).

well, mostly -- QT apps still don't look so good on the Mac -- they don't even use the system file-open dialog, which really makes them feel weird.

Daniel Carrera wrote:

Ok. I don't know C++ and I'd rather not learn it (I do know C though, but I don't like to use it for anything but math).

you really don't need to at all. It does help to understand the C++ docs, but all that means is knowing that the arguments are preceded by their type.

I've tried Tkinter on Linux. At least here it looks ugly. :frowning:

Well, it is modeled after Motif -- which is getting pretty darn ancient.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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

too bad – I don’t have any problem with Apple’s X11, but GTK apps look and act NOTHING like a Mac app – I’m a linux geek, so it’s OK by me, but many users will hate it. It’s simply not an option at this point if you want to support the Mac well.

The fact that you actually have to set a preference for “click through inactive windows” is pretty obnoxious. A larger problem I’ve seen (with plain GTK, not PyGTK) is windows opening behind the main window, invisibly to the user.

PyQt supports all of these too, however, some of them slightly better (e.g. antialiasing in OpenGL, which I’m told will finally be available in wx2.9).

huh? GL does it’s own rendering – wx doesn’t have any influence on it whatsoever.

My understanding was that antialiasing needs to be set up when you create the OpenGL context - which wx definitely influences. For instance:

http://stackoverflow.com/questions/21560/how-to-enable-multisampling-for-a-wxwidgets-opengl-program

Calling glEnable(GL_MULTISAMPLE) in a context that hasn’t been set up this way doesn’t appear to do anything.

···

On Tue, Jan 19, 2010 at 1:17 PM, Christopher Barker Chris.Barker@noaa.gov wrote:

I've never had to use a large number of frames -- a half dozen is
generally enough for all but the most manic layouts. YMMV. But true,
pack is not the best choice for advanced layouts. Grid excels at that,
but the real power comes in combining the two. Give me half a dozen
frames, grid and pack and I can give you just about any layout
imaginable, all with proper resize behavior.

I'm sure the same can be done with a roughly equal number of panels
and sizers. I personally find pack/grid considerably easier than the
sizers but maybe that's just me.

···

On Tue, Jan 19, 2010 at 3:17 PM, Christopher Barker <Chris.Barker@noaa.gov> wrote:

* Tkinter
Pros: Easy to use, well documented, easiest to deploy, mature, license.
Cons: Butt ugly.
Best for: Internal applications that don't have to look good.

Another couple pros: the Canvas and Text widgets.

but...

Bryan Oakley wrote:
...

pack is remarkably powerful and easy.

I found it to be quite painful for anything but the most basic of layouts. I
had to keep adding a huge number of frames, just for layout.

Bryan Oakley wrote:

I've never had to use a large number of frames -- a half dozen is
generally enough for all but the most manic layouts. YMMV. But true,
pack is not the best choice for advanced layouts. Grid excels at that,
but the real power comes in combining the two. Give me half a dozen
frames, grid and pack and I can give you just about any layout
imaginable, all with proper resize behavior.

I'm sure the same can be done with a roughly equal number of panels
and sizers.

Actually, that's a key distinction -- you don't need any additional panels -- sizers do layout only, they are orthogonal to the parent-child Window hierarchy. That makes them harder for folks to wrap their brain around, I suppose, but I like the separation of concerns.

I personally find pack/grid considerably easier than the
sizers but maybe that's just me.

It may be - as Robin mentioned, for some folks, Tk fits their brain better, for other, wx does.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (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