qt or gtk?

Boudewijn Rempt boud at rempt.xs4all.nl
Sun Jun 17 08:41:43 EDT 2001


D-Man <dsh8290 at rit.edu> wrote:
> On Sat, Jun 16, 2001 at 05:52:12AM +0000, Rainy wrote:
> | 
> | I want to learn python gui programming in linux. I think tk looks too ugly, so
> | I narrowed down the choice to two main contenders, qt and gtk. Which of these
> | has more complete and up-to-date python bindings? Are there other reasons
> | to prefer one of these over another for python gui work?

> Personally I like GTK better.  I don't like the way Qt tries to look
> like MS Windows.  

Funny that. For me, Qt does a very creditable job looking like MacOS
9... Or like a a sheet of tinfoil, for those who like that. In my
forthcoming book on PyQt programming I even have a chapter detailing
how to write your own pluggable look & feel for PyQt - the example
being based on the first version of MacOS.

>Glade+libglade make a great combination for rapid
> coding.  Use glade (a gui) to build the static parts of the interface,
> then load them at runtime with libglade.  You simply write the event
> handlers and connect them to the events in your code.  You can
> completely change the look of the UI without changing any code as long
> as the names of widgets and their type match (ie you don't change from
> a tree to a list).

I wouldn't work with any toolkit that didn't support that style of
working. The details may be different - with Designer and PyQt you
don't create XML files that are parsed runtime, but compile the XML
user interface definition to Python code. You can either use the
generated class immediately, or create a subclass that does the event
handling and initialisation. It's even possible to create standard
functionality (like pressing the OK button closes the dialog) in the
Designer module.

So, with Designer and PyQt, you can do the same: generate the
interface, and write a bit of code that keeps on working when you
change the interface, as long as the widgets don't disappear or have
their names changed.

-- 

Boudewijn Rempt  | http://www.valdyas.org 



More information about the Python-list mailing list