Re: Positioning a gdkmm window (in screen co-ordinates)



Hi;

On 26 June 2015 at 08:37, John Emmas <johne53 tiscali co uk> wrote:
Hi guys - for getting and setting the position of a gdkmm window we have
Gdk::Window::get_position() and Gdk::Window::move().  However, if I'm
reading the documentation correctly, these use co-ordinates that are
relative to its parent window.  For getting a window's screen co-ordinates
we can call Gdk::Window::get_origin().

You can call gdk_window_move() for a top-level window, since its
parent is the root window, and thus the coordinate system is screen
relative.

In any case…

I'm sure I'm just not seeing something - but what's the complementary
function to Gdk::Window::get_origin()?  How can I position a gdkmm window
using screen co-ordinates, rather than parent window co-ordinates?  Thanks.

… why are you trying to position a *GdkWindow* using screen
coordinates? You should use a *GtkWindow* instead, if you have a
top-level?

There are usually two issues with positioning a window on the screen:

 - window managers, which may have different ideas on where your
window should go
 - other windowing systems, which may not allow you to position
windows because they are also a WM

In short: manually positioning a top-level window is not a great idea.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[ ] ebassi [ gmail com]


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