tags:

views:

260

answers:

4

Last time I saw, GUIs in Python were extremely ugly, how's it today?

(saw some beautiful images on google images, but I don't know if are really Python's)

+1  A: 

Python has bindings for Tk, Qt, GTK, wx, and many more. There's no reason it should be any uglier than another language. You're probably thinking of a gui made with Tk, which has a reputation of being ugly. It's not specific to python, but it might be more common because it's very simple and ships with python by default.

See Gui Programming on the python wiki for more info.

Daenyth
+1 for ripping on Tk :)
Randolpho
-1 for ripping on Tk. Modern versions of tk look quite nice, and use native widgets whenever possible. The "tk is ugly" meme isn't nearly as relevant today as it was 5 years ago.
Bryan Oakley
@Bryan Oakley: Better? I haven't used it personally, only stuff made in it which is invariably hideous. Didn't realize it had gotten better
Daenyth
@Daenyth: that's one of the problems Tkinter has -- people's perception is based on tools written years ago by amateurs. It has improved a *lot* in the past few years.
Bryan Oakley
@Bryan Oakley: I'm judging from recent stuff like gitk for example. It's still quite ugly
Daenyth
@Daenyth: yes, gitk is ugly. It's not entirely the fault of Tk. The creator of gitk obviously chose to ignore the themed widgets tk has had for a few years now.
Bryan Oakley
+2  A: 

Tk is sill is the default GUI toolkit for Python, but it has a theme support from Python 2.7/3.1. It is not as ugly as before.

However, you can use some nice alternatives which still look better (IMHO) and have more functionalities :

  • wxPython : maybe the most used, cross platform and all, your applications will look the same as native.
  • PyQt or soon PySide : bindings for the Nokia Qt open source framework. There is more than just a GUI toolkit.
  • PyGTK : bindings for the GTK+ libraries

Here is more info : http://wiki.python.org/moin/GuiProgramming

Marc Demierre
"Tk still looks ugly" is highly subjective. Are you aware of the themed widget support in modern versions of Tk?
Bryan Oakley
Sorry I wasn't. I've just seen in another answer. The version shipped with my Python 2.6 didn't have it. You have to use Python 2.7 or 3.1 to have theme support. I edited my answer.
Marc Demierre
+6  A: 

Python 2.7 and 3.0 ships with the themed tk ("ttk") widgets which look much better than previous versions of Tk (though, honestly, any competent GUI developer can make even older Tk look good). Don't let the people who don't know much about Tk sway you from using it, it's still a very viable toolkit for many, many tasks. You won't be creating a Photoshop clone with it, but how many people write those kinds of apps anyway?

I've been using wxPython for the past year and would still choose Tkinter over it for most tasks. Tkinter is much simpler and in many respects more powerful. The only advantage wxWidgets has is that it has more built-in widgets, but I find many of them a bit buggy and hard to use. For most apps that most people will write, Tkinter is still an excellent choice.

Some screenshots of themed widgets are available here:

http://code.google.com/p/python-ttk/wiki/Screenshots

Here's a screenshot of a Tkinter app that uses the themed widgets on the Mac:

http://www.codebykevin.com/phynchronicity-running.png

Bryan Oakley
+1  A: 

I Think the latest Tkinter version offers native look for Macos. WxPython and QT offers native look for macos,windows and linux. GTK is abit ugly and prone to crashes on mac cause of the X11 implentation there.

Of course you could build your own GUI , that something I am trying to do with pygame.Let me clarify , I am not making a GUI library just GUI for my own application. I am making the graphics in the 3d app Blender.

My vote for Generic GUI goes to wxPython, tried it, looks great, easy to use and works like a charm across platforms. You will also find tons of info about it. Integrates well with opengl so if you want to do extreme guis on it , it can do them.

Kilon
As far as I know, the latest versions of Gtk do not longer require X11 on Mac OS X, but instead use the native widgets from Cocoa.
lunaryorn
hmm seems your are correct , there has been lots of updating since the last time I checked. Thanks for bringing this to my attention , I think I will give pyGTK another try now.
Kilon
Tkinter also offers native windows for Windows. Has done so for many years.
Bryan Oakley