# Ruby-gnome/gtk and Positioning?

**URL:** <https://www.ruby-forum.com/t/ruby-gnome-gtk-and-positioning/69491>\
**Category:** Ruby\
**Created:** [September 21, 2006, 11:38am UTC](https://www.ruby-forum.com/t/ruby-gnome-gtk-and-positioning/69491 "2006-09-21T11:38:16Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [September 21, 2006, 11:38am UTC](https://www.ruby-forum.com/t/ruby-gnome-gtk-and-positioning/69491/1 "2006-09-21T11:38:16Z")

</div>

Not sure if this is the proper place to ask for a ruby-gtk/gnome  
question, but in case its not you’d surely tell me so. 🙂

The question I have is, that aside from the constants like POS\_NONE  
(Example Code: main\_window.set\_window\_position(Gtk:🪟:POS\_NONE) )  
is there any other way to specify the precise location of a GTK app?  
Specifically I’d like to place it at “top left” corner upon startup  
of the ruby application, but I cant seem to be able to do  
exactly that.

For quick reference, only 5 constants seem to be possible at:  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AWindow#Position](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AWindow#Position)

Thanks for any help-pointer in advance.

---

<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:** [September 21, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/ruby-gnome-gtk-and-positioning/69491/2 "2006-09-21T18:16:33Z")

</div>

Marc H. wrote:

> Not sure if this is the proper place to ask for a ruby-gtk/gnome  
> question, but in case its not you’d surely tell me so. 🙂
> 
> The question I have is, that aside from the constants like POS\_NONE  
> (Example Code: main\_window.set\_window\_position(Gtk::Window::POS\_NONE) )  
> is there any other way to specify the precise location of a GTK app?  
> Specifically I’d like to place it at “top left” corner upon startup  
> of the ruby application, but I cant seem to be able to do  
> exactly that.

I apologize for what appears to be a digression, but I have been having  
terrific success with the Qt library and Ruby, and I can position a  
desktop  
frame wherever I please. I just looked at the GTK class description and  
it  
appears that you cannot specify a particular window position.

---

<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:** [September 22, 2006, 1:23am UTC](https://www.ruby-forum.com/t/ruby-gnome-gtk-and-positioning/69491/3 "2006-09-22T01:23:40Z")

</div>

On Thu, Sep 21, 2006 at 06:38:19PM +0900, Marc H. wrote:

> Not sure if this is the proper place to ask for a ruby-gtk/gnome  
> question, but in case its not you’d surely tell me so. 🙂
> 
> The question I have is, that aside from the constants like POS\_NONE  
> (Example Code: main\_window.set\_window\_position(Gtk::Window::POS\_NONE) )  
> is there any other way to specify the precise location of a GTK app?  
> Specifically I’d like to place it at “top left” corner upon startup  
> of the ruby application, but I cant seem to be able to do  
> exactly that.

You are asking the wrong layer. The window manager has the final say in  
any and all window placement. You can suggest, you can cajole, but you  
can never demand, unless you have a way of talking to the WM directly.
