[pygtk] size request in scrolled windows + viewport

Pietro Battiston toobaz at email.it
Tue Aug 18 21:44:08 WST 2009


Il giorno lun, 03/08/2009 alle 20.57 -0700, John Finlay ha scritto:
> On 08/03/2009 01:27 PM, Alessandro Dentella wrote:
> > Hi
> >
> >    I have a table with many widgets inside, so that total dimenstions are
> >    bigger that the screen so that I put it in a ScrolledWindow + ViewPort.
> >
> >    So far so good. ow I have a Window with all widgets in a pane that scrolls
> >    fine... but starts very little indeed.
> >
> >    I'd like to know how to propagate the dimentions that the table would
> >    have requested to set dimentions of the Viewport.
> >
> >    I'm a little lost between size_request/get_child_requisition and similar
> >    methds.
> >
> >    
> If the table is larger than the screen then I would assume you want the 
> window to be smaller than the table. I usually set the default size of 
> the Window so it starts up bigger than the minimum size.

Right. Though several days passed, I'd like to signal that a deeper
answer is that pygtk (and Gtk in general) doesn't know/care about the
available size of the screen. More info can be found on the discussion
following this mail:

http://mail.gnome.org/archives/gtk-devel-list/2009-January/msg00057.html

Though horrible non-portable hacks are indeed possible, the clean
"solution" is to:
- set reasonable defaults
- remember user-defined resizes across program runs

bye

Pietro



More information about the pygtk mailing list