GTK or TKinter (or what else?)

M

Marco Terzuoli

Hi,
I use python under linux and would like to create some GUI applications. I
have seen that Python can be used together woth some different graphic
libraries and would like to have a suggestion about which one to use.
I feel like GTK is better documented bud would not like to create programs
which are not fully portable. Moreover, I know you can use wxWindows as
well... I have tried it in my C program and didn't like the way events were
handled. Are there any differences in Python?
Thanks
Marco
 
T

Troy Melhase

I use python under linux and would like to create some GUI applications.

Consider PyQt and/or PyKDE. You can get both from Riverbank:

http://riverbankcomputing.co.uk/

The reasons I like using these two, in no particular order:

Quality: Qt and KDE are both very well designed
Docs: Everything is documented
Polish: Most things are consistent
Tools: The GUI designer is awesome
Platforms: Reasonable portability to Mac and Windows
Quantity: More widgets than you can shake a stick at
 
P

P

Marco said:
Hi,
I use python under linux and would like to create some GUI applications. I
have seen that Python can be used together woth some different graphic
libraries and would like to have a suggestion about which one to use.
I feel like GTK is better documented bud would not like to create programs
which are not fully portable. Moreover, I know you can use wxWindows as
well... I have tried it in my C program and didn't like the way events were
handled. Are there any differences in Python?
Thanks
Marco

I would definitely recommend GTK.
It has huge support being it now
and it's supported on windows now also.
I've some example apps here:
http://www.pixelbeat.org/talks/pygtk/

Pádraig.
 
C

Cameron Laird

I would definitely recommend GTK.
It has huge support being it now
and it's supported on windows now also.
I've some example apps here:
http://www.pixelbeat.org/talks/pygtk/

Pádraig.

I've seen two follow-ups so far, one each expressing enthusiasm
for PyGTK and PyQt. I know that still other experienced developers
favor wxPython, and Tkinter, and ... I recommend to Mr. Terzuoli
that he detail his question even more precisely; I recommend to
those advising him that they contribute to the Wikis at <URL:
http://www.python.org/cgi-bin/moinmoin/GuiProgramming >
and <URL: http://www.python.org/cgi-bin/moinmoin/GuiProgramming >.

These questions come up soooooo often.
 
D

David M. Cook

I use python under linux and would like to create some GUI applications. I
have seen that Python can be used together woth some different graphic
libraries and would like to have a suggestion about which one to use.
I feel like GTK is better documented bud would not like to create programs
which are not fully portable. Moreover, I know you can use wxWindows as
well... I have tried it in my C program and didn't like the way events were
handled. Are there any differences in Python?

While not absolutely ideal for win32 because of look-and-feel issues, Gtk
does run well under win32. There's even a win32 theme, so it just comes
down to feel in a few places. Maybe someone else can speak to the Mac
situation.

Dave Cook
 
D

David M. Cooke

David M. Cook said:
While not absolutely ideal for win32 because of look-and-feel issues, Gtk
does run well under win32. There's even a win32 theme, so it just comes
down to feel in a few places. Maybe someone else can speak to the Mac
situation.

Dave Cook

There is no native port of GTK+ 2 to the Mac, so you'd be stuck
running under the X server (not ideal). There is a port of GTK+ 1.2,
though (gtk-osx.sf.net).
 
G

Grant Edwards

[...] I know you can use wxWindows as well... I have tried it
in my C program and didn't like the way events were handled.

I had the same reaction.
Are there any differences in Python?

Not really, unless you use a higher-level wrapper on top of
wxWindows -- something like "wax". Wax hides most of the event
details.
 
G

Greg Krohn

Marco Terzuoli wrote:
...Moreover, I know you can use wxWindows as
well... I have tried it in my C program and didn't like the way events were
handled.

What didn't you like about the event handling? If it's the IDs and EVT_*
functions, they sort of remedied that in the most recent version (2.5).
Instead of this:

You can do this:
Of course what would be really slick is if they implemented event
handling as kwargs[1]. Also, I hear that wxPython is Windows-centric, so
if you're developing on and/or mostly using Linux, you might be better
off with something else.


greg

[1] http://tinyurl.com/2n5gl I did a rough patch for this.
 
G

Grant Edwards

It would be nice if the need to pass all those -1s
could be eliminated as well...

Been there, whined about that. :)

Right now I'm using wax, (a wxWindows wrapper that hides some
of that sort of thing).
 
R

Roger Binns

Grant said:
Right now I'm using wax, (a wxWindows wrapper that hides some
of that sort of thing).

In relation to an earlier thread, I took a look through my
Qt book again, and noted that it does require passing in
the parent when creating a widget (although it is passed as
the last parameter which seems wrong to me) and the layout
and containment hierarchies are also different.

The '-1' issue can't really go away unless Python allowed
default arguments in the middle of an argument list, which
would probably be a bad thing.

Roger
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top