Forum: Ruby-Gnome 2 Setting absolute position of a Window in GTK - is there no top-left shortcut?

4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (shevegen)
on 2013-12-04 18:39
Hi guys.

I am looking at the documentation:

  http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%...

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?
394f372e936f867e4e43bfd1315a0a4e?d=identicon&s=25 Masafumi Yokoyama (masafumi_y)
on 2013-12-05 05:16
(Received via mailing list)
Hi,

2013/12/5 Marc Heiler <ruby-forum-incoming@andreas-s.net>:
> 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%...
https://developer.gnome.org/gtk3/stable/GtkWindow....

--
Masafumi Yokoyama
https://github.com/myokoym
4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (shevegen)
on 2013-12-07 13:32
Thanks!

That works nicely!
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.