How to do_size_allocate properly in a gtk.Viewport subclass

Joel Hedlund joel.hedlund at gmail.com
Thu Oct 23 12:16:17 EDT 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 daa.com.au!

/Joel



More information about the Python-list mailing list