Re: EuGTK - size, position of a GtkWindow
- Posted by jimcbrown (admin) Oct 26, 2010
- 1694 views
How do you get the width, height, x position, y position of a GtkWindow?
The best way to do this is probably to get get_geometry() of GdkWindow, http://www.pygtk.org/docs/pygtk/class-gdkwindow.html#method-gdkwindow--get-geometry
You'll need to obtain the GdkWindow of your GtkWindow first.
There is a get_position() method for GtkWindows. http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--get-position
You can also use the get_origin() method for GdkWindows, http://www.pygtk.org/docs/pygtk/class-gdkwindow.html#method-gdkwindow--get-origin
get_size() doesn't work on a GtkWindow.
It should work. See http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--get-size (note that some caveats of get_size() on a GtkWindow are stated in this link, and look at the mention of configure_event).
GdkWindow has its own get_position as well, http://www.pygtk.org/docs/pygtk/class-gdkwindow.html#method-gdkwindow--get-position