Re: [gtk-list] FAQ Addition? (was Re: position)
- From: Tim Janik <timj gtk org>
- To: gtk-list redhat com
- cc: maestrox geocities com, gale gimp org, amundson gimp org
- Subject: Re: [gtk-list] FAQ Addition? (was Re: position)
- Date: Sun, 27 Jun 1999 01:12:38 +0200 (CEST)
On Sat, 26 Jun 1999, Daniel J. Kressin wrote:
> 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,...)
well, gdk_window_get_origin() might be more appropriate here, since
it really gives only the origin and not the size as well.
> 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
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]