This is the mail archive of the
guile-gtk@sources.redhat.com
mailing list for the Guile project.
Re: getting the size and origin of a GtkWindow
Russell McManus <russell.mcmanus@msdw.com> writes:
> How to get GtkWindow's position and size?
> From: Carlos Pereira <carlos pehoe civil ist utl pt>
> 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?