[pygtk] Size of visible portion of scrolledwindow

James Henstridge james@daa.com.au
Fri, 7 Jul 2000 14:06:12 +0800 (WST)


On Thu, 6 Jul 2000, Scott F. Johnston wrote:

> A quick Gtk+ question for use in my pygtk code:
> 
> I've got a drawing area in a ScrolledWindow.
> How do I find out the coordinates of the visible
> portion of the drawing area?
> 
> I need to do some clipping against it.
> I would expect that it would be available
> as an (x, y, w, h) of the upper left corner and
> the width and height of the visible portion,
> but I can't seem to find it anywhere. Get_allocation returns the
> overall size of the drawing area, not just the
> windowed portion, and expose events are great
> at giving me sub-portions of the window that
> need to be updated.

Use the get_[hv]adjustment() methods of the GtkScrolledWindow to get the
adjustments, then look at the value and page_size attributes of those
adjustments to get the visible area.

> 
> Thanks in advance,
> 
> S
> 

James.

-- 
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/