GUI Frameworks in Python?

Sridhar R sridharinfinity at yahoo.com
Tue Apr 6 05:04:19 EDT 2004


hungjunglu at yahoo.com (Hung Jung Lu) wrote in message news:<8ef9bea6.0404041009.26ae2683 at posting.google.com>...
> sridharinfinity at yahoo.com (Sridhar R) wrote in message news:<930ba99a.0404030246.786455f5 at posting.google.com>...
> > 
> > Man, you better use PyGTK (http://pygtk.org). It's portable (See pygtk
> > faq for windows port). It's neet (API).
> > Try also `glade`, `libglade`.
> > http://glade.gnome.org , I think?
> 
> Can someone outline some differences/advantages of PyGTK vs. wxPython?

  Sure.

> 
> A first look at PyGTK shows me a more Unix-like look-and-feel. On the
> other hand, wxPython on Windows does look very much like any other
> Windows applications.

  Wrong.  GTK apps do look with native look and feel.  For Windows,
look at the screenshots from the wimp project

http://gtk-wimp.sourceforge.net

  I am sure about Mac too, as I have seen screenshots before (probably
linked from GTK homepage)

[You may better download download pygtk from windows from the link
given the pygtk faq page]

> 
> Is the event handling in PyGTK cleaner/better than wxPython? Does

  Of course.  Have looked at libglade ( is availble as glade module in
pygtk).  You can even write a small function to autoconnect functions
to events.  Say you can write function in a format like
  def on_button1__clicked(self,button):
      "This function is called when button1 emits 'clicked' signal"

  ... stilll many more functions like this ...

  and you can even write your own function that autoconnects functions
with their object/events.

  Instrospection in Event Handling!

> PyGTK have more widgets? 

   Sure.  Also have a look at the GtkExtra (also pygtkextra) project.
Writing new widgets is also pretty neat in PyGTK.

> e FAQ of PyGTK does not have a comparison
> section regarding other GUI toolkits, I think it would be useful if

  If not, you can try them yourself

> one were included. (If you go to wxPython's mainpage, you read "Why
> the hell hasn't wxPython become the standard GUI for Python yet?", and
> also "BTW, great work! I've definitively switched from Tk. I work on
> Win32, anybody who works on Win32 should switch!". Comments like that.
> Readers can immediately know the relationship to Tk, and wxPython's
> platform friendliness for Win32.) 

  But, those people wouldn't have used PyGTK (or GTK) before.   Don't
get a mind-shift just bcoz of some famous personality has said it. 
Usually I will try out the possiblities and then choose from the
domain.

> Given the lack of comparison, I
> would guess that GTK is unix-friendly, since Unix people usually would
> mention little or nothing about Windows. :) 

  As I said before, look at the screenshots. Or see this,
http://gtk-wimp.sourceforge.net/screenshots/

Gimp in WinXP
http://gtk-wimp.sourceforge.net/screenshots/gfx/gimp-winxp.png

> Continuing with my guess:
> are there any caveats for using PyGTK for Windows programmers?

  PyGTK apps were little slow in Windows.  But since the Wimp theme
(http://gtk-wimp.sourceforge.net) uses native win32 api calls to draw
widgets it should be pretty fair when compared to normal win32 apps.

  Also try the tutorial at pygtk site

  Also see http://developer.gnome.org
  And very important try Glade, the GUI builder which generates XML
files which can be given to the `glade` module of pygtk to build GUI
dynamically.

> 
> ---------------------------
> 
> Given my observations, is it fair to say:
> 
> (a) wxPython is widely used for Windows Python programmers, and

     May be.  But you can't say that as the best, without looking at
other toolkits.  I found PyGTK great.

> (b) PyGTK is widely used for Unix Python programmers?

    GTK is widely used in the UNIX world!  That's true.

> regards,
> 
> Hung Jung

   Happy programming.



More information about the Python-list mailing list