FAQ Addition? (was Re: [gtk-list] Re: position)



Tim Janik wrote:
> 
> On Sat, 26 Jun 1999, Harold Campbell wrote:
> 
> > Is there a dependable way to find the physical x/y coordinates of a
> > widget?
> 
> a widget relative to its parent?
> widget->allocation.x/y
> a widget's window relative to the root window?
> gdk_window_get_geometry (widget->window,...)
> a window widgets window manager frame position (i.e. for --geometry 
> option)?
> gdk_window_get_deskrelative_origin (widget->window,...)

Assuming the answers are correct, I think this would be an excellent
addition to the faq.

<<begin>>
Q: How do I find the x/y coordinates of a widget...
 ...relative to its parent?
A: widget->allocation.x and widget->allocation.y
 ...relative to the root window?
A: gdk_window_get_geometry (widget->window,...)

Q: How do I find a window widget's window manager frame position (i.e.
for the --geometry commandline option)?
A: gdk_window_get_deskrelative_origin (widget->window,...)
<<end>>

-- 
Dan
 ____    Kressin   ____   .-----------------------------------.
/___ \____________/ __ \  | Unix SysAdmin                     |
    \  \    /      /  \ | | Frontier Communications           |
 ___/ __\/\/rench_ \__/ | | dkressin@gb.frontiernet.net       |
\____/            \____/  | http://www.vib.org/wrench/        |
                          `-----------------------------------'



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