Re: Translating co-ordinates from local to screen space
- From: jcupitt gmail com
- To: Matthew Allen <list sydneyband com au>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Translating co-ordinates from local to screen space
- Date: Fri, 11 Jun 2010 12:11:46 +0100
On 11 June 2010 11:50, Matthew Allen <list sydneyband com au> wrote:
I'm trying to translate co-ordinates from local widget space into screen
space and back again. Is that possible with GTK?
You can use _get_allocation() to get the size and position of a widget
within it's parent:
http://library.gnome.org/devel/gtk/stable/GtkWidget.html#gtk-widget-get-allocation
There's also a more general thing that will translate between any two
widgets which share a common ancestor:
http://library.gnome.org/devel/gtk/stable/GtkWidget.html#gtk-widget-translate-coordinates
If you're trying to turn mouse x/y into widget x/y, I think that
should be done for you, as far as I know.
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]