[Gtk-sharp-list] How do I get the X,Y coordinates of a Gtk.WIndow?

John Luke john.luke@gmail.com
Thu, 14 Apr 2005 13:17:30 -0400


Hello,
On Fri, 2005-04-15 at 00:56 +0800, Kevin Francis wrote:
> I cannot figure this out. The closest I got was the configure_event, 
> which although works fine for the window size, returns 0,0 for coordinates.
> 
> Please, will someone enlighten me as to the voodoo of this fine art? And 
> while you're at it, please tell me that Window.Move() before a window is 
> shown will set the initial position, and if not how can I do this?

In MonoDevelop we use:

GetPosition (out x, out y);
GetSize (out width, out height);

and

Move (x, y);
Resize (width, height);

looking at these two files might help if you need more info:
MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/WorkbenchMemento.cs
MonoDevelop/Core/src/MonoDevelop.Base/Gui/Workbench/DefaultWorkbench.cs