# Setting absolute position of a Window in GTK - is there no top-left shortcut?

**URL:** <https://www.ruby-forum.com/t/setting-absolute-position-of-a-window-in-gtk-is-there-no-top-left-shortcut/237884>\
**Category:** Ruby-Gnome 2\
**Created:** [December 4, 2013, 6:39pm UTC](https://www.ruby-forum.com/t/setting-absolute-position-of-a-window-in-gtk-is-there-no-top-left-shortcut/237884 "2013-12-04T18:39:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [December 4, 2013, 6:39pm UTC](https://www.ruby-forum.com/t/setting-absolute-position-of-a-window-in-gtk-is-there-no-top-left-shortcut/237884/1 "2013-12-04T18:39:41Z")

</div>

Hi guys.

I am looking at the documentation:

[http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AWindow#Position](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AWindow#Position)

Let me copy paste here:

POS\_NONE  
No influence is made on placement.  
POS\_CENTER  
Windows should be placed in the center of the screen.  
POS\_MOUSE  
Windows should be placed at the current mouse position.  
POS\_CENTER\_ALWAYS  
Keep window centered as it changes size, etc.  
POS\_CENTER\_ON\_PARENT  
Center the window on its transient parent (see  
Gtk::Window#transient\_for=).

Ok… I see 5 options… but where is POS\_LEFT or POS\_TOP? Are these not  
available in Gtk? And, where could I find official documentation about  
this, I mean, Gtk-documentation rather than ruby-gtk documentation?

---

<div class="post-metadata">

**Author:** ![quik77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/dec6dc/32.png) [@quik77](https://www.ruby-forum.com/u/quik77)\
**Post date:** [December 5, 2013, 5:16am UTC](https://www.ruby-forum.com/t/setting-absolute-position-of-a-window-in-gtk-is-there-no-top-left-shortcut/237884/2 "2013-12-05T05:16:53Z")

</div>

Hi,

2013/12/5 Marc H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Ok… I see 5 options… but where is POS\_LEFT or POS\_TOP? Are these not  
> available in Gtk? And, where could I find official documentation about  
> this, I mean, Gtk-documentation rather than ruby-gtk documentation?

One way I think that you can use Gtk::Window#move.

For example:

```
window = Gtk::Window.new
window.move(0, 0)

```

[http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AWindow#move](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AWindow#move)

> **[Gtk-3.0](https://docs.gtk.org/gtk3/)**
>
> Reference for Gtk-3.0

–  
Masafumi Y.

> **[myokoym - Overview](https://github.com/myokoym)**
>
> small application creator. myokoym has 295 repositories available. Follow their code on GitHub.

---

<div class="post-metadata">

**Author:** ![quik77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/dec6dc/32.png) [@quik77](https://www.ruby-forum.com/u/quik77)\
**Post date:** [December 7, 2013, 1:32pm UTC](https://www.ruby-forum.com/t/setting-absolute-position-of-a-window-in-gtk-is-there-no-top-left-shortcut/237884/3 "2013-12-07T13:32:05Z")

</div>

Thanks!

That works nicely!
