PyGUI as a standard GUI API for Python?

lkcl luke.leighton at googlemail.com
Sat Oct 11 15:40:34 EDT 2008


On Oct 11, 3:31 pm, David Boddie <da... at boddie.org.uk> wrote:
> On Saturday 11 October 2008 11:19, lkcl wrote:
>
> > pyqt4 has the concept of layouts.  a layout can be a horizontal
> > layout, vertical, grid, and you can even specify the percentage or
> > ratio of the width (or height) that individual cells can use. you
> > attach a layout to a widget; you can attach layouts to layouts.  you
> > can remove layouts from widgets.  what you _can't_ do is _remove_
> > layouts from layouts.
>
> You can remove layouts from layouts with the QLayout.removeItem() method.

 yes... it didn't work.  a layout within a layout - i think it was a
QHorizontalLayout within a QGridLayout - didn't want to be removed.
it's probably a bug.
> These days, you'd probably use PyQt4's WebKit integration for HTML
> rendering, anyway, though I imagine that it doesn't help you much if
> you're already using WebKit directly.

 [see below...]

> You can write your own layouts as well, but maybe that's more work than
> you're prepared to do,

 definitely.

> especially now that you seem to have settled on
> WebKit as your toolkit.

 well, it just made vast amounts of sense - cut out all the middle
men.  if you're going to pull in a 17mb binary dependency, why do it
in a clumsy way?

 in order to pull in flash plugins and other material, the accepted
method in pygtk2 is to use python-gtk-mozplugger.  that's crazy.
embed an _entire_ web browser, just to pull in a flash component.
likewise, for doing a single bit of HTML, in pyqt4 and/or pygtk2, pull
in a 17mb binary dependency using python-webkit-qt4 and/or
pywebkitgtk, _just_ to display _one_ bit of HTML text??  _that's_
crazy.

especially as webkit actually has far better rendering capability,
features and flexibility than any of the standard desktop widget sets
which had been designed for the job!

wonderfully ironic...

oh - for completeness, if anyone's reading this and goes "no chance i
will _ever_ convert to the pyjamas API because i've spent so much time
writing pygtk2 apps" - there is a project by luis pamirez, where he
has _reimplemented_ gtk.py, gobject.py and gdk.py to sit _on top_ of
the pyjamas DOM model.

at present, it's only available in the subversion repository of
http://code.google.com, and you'll need to check out a revision some
time around sep 2007 of the llpamies branch.

basically, what that will give you is a means to run your pygtk2
applications... in a web browser!

very cool.  i'll do a port to pyjamas-desktop at some time, if i have
a need for it, and will be happy to help guide anyone who wants to
spend the time on it themselves.

> especially now that you seem to have settled on WebKit as your toolkit.

well, it's not _my_ toolkit - i just use it.  but you're right
inasmuch as i won't be initiating any new applications using pyqt4 or
pygtk2, not out of personal choice, anyway.

l.



More information about the Python-list mailing list