How to do_size_allocate properly in a gtk.Viewport subclass

Joel Hedlund joel.hedlund at
Thu Oct 23 18:16:17 CEST 2008

Joel Hedlund wrote:
> And another relevant question: am I overcomplicating this? 

Yes. :-)

The proper way of doing this is to pack the widget in a container, and 
then add the container (with viewport) to a scrolledwindow.

For example, for a centered widget choose a 1x1 gtk.Table and attach the 
widget using xoptions = yoptions = gtk.EXPAND (and not gtk.FILL). For a 
widget glued to the upper left corner choose a gtk.Alignment().

Thanks John Finlay at pygtk at!


More information about the Python-list mailing list