Re: [gtk-list] How to get Position of a Window?



Oliver Schulze wrote:
> 
> Hi,
> Anyone know how to get the position of a window?
> I have tried with gdk_window_get_position() but with no positive
> results. :-(
> Many Thanks
> Oliver
> --
> ~~~~~~~~~~~~~~~~~~
> Oliver Schulze L.
> oliver@pla.net.py
> Asuncion-Paraguay
> ~~~~~~~~~~~~~~~~~~X
> 
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

Well, I realize that the gdk_window_get_position() only work after you
call gtk_main().

The result of the gdk_window_get_position() function is the position of
the client space, without the Window Manager decoration.

Is there a function to get the position of the window with the Window
Manager decoration?

I have problem when trying to save the window position when my app
exits.
The solution I found is put the window at (0,0) with
gtk_widget_set_uposition().
Then, when the WM decoration apears it move the window a litle to the
SouthEast.
The I call gdk_window_get_position() and I recive (5, 25) not (0, 0).
That give me the dimension of the WM decoration and save it in an rc.
The next time I want to put a window at position (x, y) I use:
gtk_widget_set_uposition(x-5, y-25);

I hope this help someone.
Oliver
-- 
~~~~~~~~~~~~~~~~~~
Oliver Schulze L.
oliver@pla.net.py
Asuncion-Paraguay
http://www.pla.net.py/home/oliver/gpppkill/
~~~~~~~~~~~~~~~~~~X



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]