[pygtk] How do I find out if a widget is viewable?

David Hirschfield davidh at ilm.com
Sat Oct 14 05:23:34 WST 2006


I asked this question a little while back, but didn't really get any 
response...I try asking it better:

I'm looking for the simplest way to determine if a displayed pygtk 
widget is "viewable" (not the same thing as "visible" as I explain below).
By "viewable" I mean that the user is actually able to see some or all 
of the widget's extent (the rectangle enclosing the widget on screen) 
when they are looking at the window the widget is in.

For example:

A button that is currently completely scrolled out of view in a 
scrolling window is not viewable.
A text box in a notebook tab pane that is not the front-most tab pane is 
also not viewable.

This isn't really the same as whether a widget is "exposed" because if 
window "A" covers the window that the widget is in, window "B", and the 
widget was viewable in window "B", it would *still* be considered 
viewable, even though it is covered by window "A".

This also isn't the same thing as the widget.visible value, since that 
will return True even if the widget is in a notebook page that isn't the 
front page.

So, does anyone have any code that does something similar?
Is this in pygtk somewhere, and I'm just not seeing it?

Let me know if I'm not explaining this well, I've had trouble describing 
it to coworkers.
-David

-- 
Presenting:
mediocre nebula.



More information about the pygtk mailing list