By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,965 Members | 1,962 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,965 IT Pros & Developers. It's quick & easy.

GTK or TKinter (or what else?)

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
On Wednesday 19 May 2004 11:57 pm, Marco Terzuoli wrote:
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

--
Troy Melhase, tr**@gci.net
--
It is terrible to contemplete how few politicians are hanged. - G. K.
Chesterton
Jul 18 '05 #2

P: n/a
P
Marco Terzuoli wrote:
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.
Jul 18 '05 #3

P: n/a
In article <lb******************@news.indigo.ie>, <P@draigBrady.com> wrote:
Marco Terzuoli wrote:
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.


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.
--

Cameron Laird <cl****@phaseit.net>
Business: http://www.Phaseit.net
Jul 18 '05 #4

P: n/a
In article <Sx*******************@twister2.libero.it>, Marco Terzuoli wrote:
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
Jul 18 '05 #5

P: n/a
At some point, "David M. Cook" <da******@nowhere.net> wrote:
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).

--
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca
Jul 18 '05 #6

P: n/a
On 2004-05-20, Marco Terzuoli <ma************@libero.it> wrote:
[...] 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.

--
Grant Edwards grante Yow! Are we THERE yet? My
at MIND is a SUBMARINE!!
visi.com
Jul 18 '05 #7

P: n/a
Marco Terzuoli wrote:
<snip>
...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:
ID_SEARCH = wx.NewId()
button = wx.Button(parent, ID_search, "Search")
EVT_BUTTON(ID_SEARCH, searchFunction)
You can do this: button = wx.Button(parent, -1, "Search")
button.Bind(EVT_BUTTON, searchFunction)


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.
Jul 18 '05 #8

P: n/a
Greg Krohn wrote:
You can do this:
>>> button = wx.Button(parent, -1, "Search")
>>> button.Bind(EVT_BUTTON, searchFunction)


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

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Jul 18 '05 #9

P: n/a
In article <2h************@uni-berlin.de>, Greg Ewing wrote:
Greg Krohn wrote:
You can do this:
>>> button = wx.Button(parent, -1, "Search")
>>> button.Bind(EVT_BUTTON, searchFunction)


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).

--
Grant Edwards grante Yow! Is there something
at I should be DOING with a
visi.com GLAZED DONUT??
Jul 18 '05 #10

P: n/a
Grant Edwards wrote:
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
Jul 18 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.