Re: Getting a Widget's screen coordinates

j.m.maurer wrote:

Is there a way to get the actual screen coordinates of a Widget?
Widget->allocation.{x,y} only gives relative coordinates AFAICT.

Any help would be greatly appreciated!

gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

int x,y;

   gdk_window_get_origin(widget->window, &x,&y);
   x += widget->allocation.x;
   y += widget->allocation.y;
/* x,y contain screen coordinates */


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