Pike v8.1 release 6

Method GTK2.Window()->move()


Method move

GTK2.Window move(int x, int y)

Description

Asks the window manage to move the window to the given position. Window managers are free to ignore this; most window managers ignore request for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown.

Note: the position is the position of the gravity-determined reference point for the window. The gravity determines two things: first, the location of the reference point in root window coordinates; and second, which point on the window is position at the reference point.

By default the gravity is GDK2.GRAVITY_NORTH_WEST, so the reference point is simply the x,y supplied to move(). The top-left corner of the window decorations (aka window frame or border) will be place at x,y. Therefore, to position a window at the top left of the screen, you want to use the default gravity (which is GDK2.GRAVITY_NORTH_WEST) and move the window to 0,0.

To position a window at the bottom right corner of the screen, you would set GDK2.GRAVITY_SOUTH_EAST, which means that the reference point is at x + the window width and y + the window height, and the bottom-right corner of the window border will be placed at that reference point.