You are not logged in.

#1 2011-12-10 00:56:07

kang
Member
Registered: 2010-08-07
Posts: 83

Whats your favority UI toolkit for python?

- GTK2 + PyGtk (a bit dated, but maintained)
- GTK3 + pygobject (it works, but the promised OSX native support is gone with Carbon)
- wxWidget (it emulates GTK on Linux, and doesn't look so native on OSX)
- Qt (its not as quick to code for if you want custom widgets, although theres nice parts)
- etc.

Just curious.

Offline

#2 2011-12-10 03:18:32

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Whats your favority UI toolkit for python?

kang wrote:

wxWidget (it emulates GTK on Linux, and doesn't look so native on OSX)

wxWidgets (wxPython) actully uses GTK on Linux. On Windows it uses the Windows API and on Mac it uses Cocoa, so the same program with the same code looks completely native no matter which OS you use. (in theory wink)

For example, here is an application I made running on Linux and Mac:

http://sourceforge.net/projects/enbudge … ots/288301
http://i1-mac.softpedia-static.com/scre … dget_2.jpg

Did you have an experience where a wxWidgets application didn't look native on a Mac?

kang wrote:

GTK3 + pygobject

I'm currently learning how to make a GUI using Glade and implementing functionality using Python + GTK3. I haven't done much with it, but I'm impressed with what I've seen so far. I plan to use it more, so I guess you could call it my current favorite. I haven't tried Qt.

Offline

#3 2011-12-10 07:40:46

aspidites
Member
Registered: 2011-03-11
Posts: 30

Re: Whats your favority UI toolkit for python?

kang wrote:

- Qt (its not as quick to code for if you want custom widgets, although theres nice parts)

Just curious.

Relative to what? Could you please qualify this statement?


coder formally known as EnvoyRising

Offline

#4 2011-12-10 09:38:52

lunar
Member
Registered: 2010-10-04
Posts: 95

Re: Whats your favority UI toolkit for python?

@kang:  Use Qt, if you want platform independence.  It is by far the most sophisticated toolkit when it comes to integration into different platforms.  If written correctly, a Qt application will use the platforms standard look and feel, standard shortcuts, standard dialogs, etc.  Qt applications even try to integrate into Gnome and KDE, using the current UI theme of the Desktop environment, and trying to adapt to its conventions (e.g. changing  the button order of dialogs).  A Qt application will use a Gtk file dialog in Gnome, and a KDE file dialog in KDE.  No other toolkit goes this far.

If platform independence is not an issue, Gtk 3 is just as well.  If you're writing for the Gnome desktop only, use Gtk 3.  Do not use Gtk 2 for new projects, it's end of life is foreseeable. 

Do not use wxWidgets, too.  It's API is archaic (e.g. numeric IDs, global event constants, string-based list and tree widgets), and it lacks much of what is required or at least useful for modern applications, including but not limited to a decent painting API (like QGraphicsView or cairo), SVG support, a multimedia API for audio and video playback, and a browser engine with support for modern HTML and Javascript.

Last edited by lunar (2011-12-10 09:41:09)

Offline

#5 2011-12-10 13:15:32

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,094

Re: Whats your favority UI toolkit for python?

kang wrote:

- GTK2 + PyGtk (a bit dated, but maintained)

gobject(-introspection) exists for gtk2 too.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2011-12-10 14:17:59

spookyln
Member
From: Czech Rep
Registered: 2009-02-10
Posts: 39

Re: Whats your favority UI toolkit for python?

tkinter and ttk.

Offline

#7 2011-12-10 18:58:32

kang
Member
Registered: 2010-08-07
Posts: 83

Re: Whats your favority UI toolkit for python?

lunar wrote:

@kang:  Use Qt, if you want platform independence.  It is by far the most sophisticated toolkit when it comes to integration into different platforms.  If written correctly, a Qt application will use the platforms standard look and feel, standard shortcuts, standard dialogs, etc.  Qt applications even try to integrate into Gnome and KDE, using the current UI theme of the Desktop environment, and trying to adapt to its conventions (e.g. changing  the button order of dialogs).  A Qt application will use a Gtk file dialog in Gnome, and a KDE file dialog in KDE.  No other toolkit goes this far.

If platform independence is not an issue, Gtk 3 is just as well.  If you're writing for the Gnome desktop only, use Gtk 3.  Do not use Gtk 2 for new projects, it's end of life is foreseeable. 

Do not use wxWidgets, too.  It's API is archaic (e.g. numeric IDs, global event constants, string-based list and tree widgets), and it lacks much of what is required or at least useful for modern applications, including but not limited to a decent painting API (like QGraphicsView or cairo), SVG support, a multimedia API for audio and video playback, and a browser engine with support for modern HTML and Javascript.

I fear I agree with that overall.

Just for precisions: by "emulate" I meant that wxWidget is not native, it interfaces with GTK. But the API is also odd.
GTK2 and gobject: yes but no. Eventually it'll be left unsupported as a whole and require installing the old GTK2 libs. No point  not using GTK3 unless you want GTK2 integration.

GTK3 vs Qt: Yes, I like Qt but it takes longer to core for it, mostly because Qt Creator is rather complicated (the UI is absolutely not intuitive) and not exactly bug free. Glade  is really quick and simple.
When coding the actual UI, Qt is in fact OK. But I like the idea of being able to tweak the UI in a separate editor easily of course.

Also GTK3 claims OSX support, but there aren't so many examples of that.

The main point I'd say, is that using Python+toolkit means you want some kind of RAD.

Note that I'm using Qt4 *and* GTK2 so far, in python and C, I'm just curious what people generally like.

As for Tk smile

Offline

#8 2011-12-10 20:38:39

aspidites
Member
Registered: 2011-03-11
Posts: 30

Re: Whats your favority UI toolkit for python?

kang wrote:

GTK3 vs Qt: Yes, I like Qt but it takes longer to core for it, mostly because Qt Creator is rather complicated (the UI is absolutely not intuitive) and not exactly bug free. Glade  is really quick and simple.
When coding the actual UI, Qt is in fact OK. But I like the idea of being able to tweak the UI in a separate editor easily of course.

Then use Qt Designer ("designer" from command line) rather than Qt creator. While Qt Creator has rudimentary python syntax highlighting, there are better tools for the job when writing in python. The only reason I can think of to actually use Creator is if you want to use the QML designer, but I've always found it easier to just write QML files by hand. When I was writing Qt gui apps in python, I would use designer to write the UI, use pyuic (or pyside-uic) to convert the .ui file to an importable python module, and write the code in vim.


coder formally known as EnvoyRising

Offline

#9 2011-12-10 22:06:54

lunar
Member
Registered: 2010-10-04
Posts: 95

Re: Whats your favority UI toolkit for python?

@kang:  You're using Qt Creator for Python development?!  I've never heard of anyone actually doing this.  Qt Creator is a C++ IDE and not meant to be used for Python.  Instead just do as aspidites said and directly use the Qt Designer to create UI files, and implement the corresponding Python code in a decent Python editor, e.g. Emacs, VIM, Eclipse+Pydev, or whatever else you like.

Offline

Board footer

Powered by FluxBB