Widget absolute screen position

View: New views
3 Messages — Rating Filter:   Alert me  

Widget absolute screen position

by Piotr Budny-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
is there any way to get widget's X and Y coordinates according to the current
screen resolution?

My aim is to know if the widget is placed (drawn) in top or bottom half.

Best regards,
Piotr Budny
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Re: Widget absolute screen position

by Chris Howie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 15, 2009 at 12:30 PM, Piotr Budny<piotr.budny@...> wrote:
> Hello,
> is there any way to get widget's X and Y coordinates according to the current
> screen resolution?

int x, y;
yourWidget.GdkWindow.GetOrigin(out x, out y);

--
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Re: Widget absolute screen position

by Piotr Budny-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dnia środa, 15 lipca 2009, napisałeś:
> On Wed, Jul 15, 2009 at 12:30 PM, Piotr Budny<piotr.budny@...> wrote:
> > Hello,
> > is there any way to get widget's X and Y coordinates according to the
> > current screen resolution?
>
> int x, y;
> yourWidget.GdkWindow.GetOrigin(out x, out y);

Almost forget to thank you.

Thanks!

Regards,
vip;
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list