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!
 Marc

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Hello,
---
int x,y;

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

Olexiy




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