Re: [gtk-list] Titlebars and set_uposition



In a previous message, Brian C. Lane says:
>   How can I find out how tall the titlebar is and whether or not it exists
> (so I can place the window correctly with +0+0), also I need to know about
> the resize bar so that when someone does a -geometry -0-0 it is placed
> correctly in the lowerr right corner).

You have to walk up the window tree (X windows, not GTK windows) using
XQueryTree() in a loop till you find the window whose parent is the root 
window.  This will be the Window Manager window.  Grab the window attributes 
for this window (XGetWindowAttributes()).  Then you do an XTranslateCoords() 
between this window and your widgets window.  The offset values returned from 
XTranslateCoords() should be added to the position of the WM windows x,y 
coordinates to position your window.

To my knowledge there isn't any way to do this from GTK/GDK.  I looked, but
there weren't any routines that would translate the coordinates or to query
the parent window or the children of a window.  I probably just missed them.  
-- 
Michael J. Hammel           |Webster's definition of Win95: 32bit extensions and
The Graphics Muse           |graphical shell for a 16bit patch to an 8bit OS 
mjhammel@graphics-muse.org  |originally coded for a 4bit cpu, written by a 2 bit
http://www.graphics-muse.org  company, that can't stand 1 bit of competition.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]