On Wed, Dec 06, 2000 at 08:55:37PM -0700, Shane Spencer wrote:
> James Henstridge wrote:
> > >
> > > I was wondering how to tell a widgets screen geometry x,y,width,height..
> > > I can get the width height through size_request but nothing else.. :(
> >
> > You can use the get_allocation() method to get the space allocated to the
> > widget (as a 4 tuple (x,y, width,height)).
> >
> > James.
>
> The tuple it gives me is [0, 0, width, height] never giving me the
> allocated X, Y
These positions are always relative to the parent window. Tk has
extra attributes called root_x and root_y which return the position
relative to the root window (which is usually filling the whole screen).
But I guess the better question is: What are you trying to achieve ?
Usually, you don't need to care about the position of the widget.
> So can anybody tell me how to get parent widget ID's? If so a recursive
> function will be able to tell me what the X,Y position of the Widget is
> in relation to the Main Window.. :)
I've written a patch for PyGTK which gives every widget the
attribute "parent" but that has been payed by a customer and
I'm not yet allowed to give that away :-( It's a small patch
and something very valuable (for example, it allows to add
tooltips to the columns of a CTree/CList !).
--
==============================================
Sowatec AG, CH-8330 Pf�ffikon (ZH)
Witzbergstr. 7, http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, [EMAIL PROTECTED]
==============================================
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk