From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Vollmer To: Russell McManus Cc: guile-gtk@sourceware.cygnus.com Subject: Re: getting the size and origin of a GtkWindow Date: Sun, 04 Feb 2001 10:12:00 -0000 Message-id: <87snlu74b3.fsf@zagadka.ping.de> References: <200101292106.QAA10520@hqsmh3.ms.com> <87puh6x7mw.fsf@zagadka.ping.de> X-SW-Source: 2001-q1/msg00009.html Russell McManus writes: > How to get GtkWindow's position and size? > From: Carlos Pereira > To: gtk-app-devel-list redhat com > Subject: How to get GtkWindow's position and size? > > >How to get GtkWindow's position and size? > > You can use, for example: > > gdk_window_get_origin (window->window, &x, &y); > gdk_window_get_size (window->window, &w, &h); Ahh, I see. gdk-window-get-size is already there, but gdk-window-get-origin needs to be added (which I have done in CVS). You can use them like this: (define w (gtk-window-new 'toplevel)) ... (gdk-window-get-size (gtk-widget-window w)) => (200 . 200) As you can see, the functions return the two coordinates as a cons of two numbers. Does this help?