Forum: Ruby-Gnome 2 Position Gtk::Window where on the screen?

Posted by Marc Heiler (shevegen)
on 2011-10-11 17:59
Hi,

Can I specify where my Application starts on the screen?

Like at x:5 px and y:10 px?
Posted by Vincent Carmona (vinc-mai)
on 2011-10-11 18:14
(Received via mailing list)
2011/10/11 Marc Heiler <ruby-forum-incoming@andreas-s.net>:
> Hi,
>
Hi.

> Can I specify where my Application starts on the screen?
>
> Like at x:5 px and y:10 px?
>
Try Gtk::Window#move(5, 10)

> ruby-gnome2-devel-en mailing list
> ruby-gnome2-devel-en@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ruby-...
>



--
Vincent Carmona
Posted by jake kaiden (lljk)
on 2011-10-12 03:23
also check out Gtk::Window#gravity=, which changes where the points
specified in Gtk::Window#move are relative to...  for example:

 (`win` is a Gtk::Window)

    win.gravity= Gdk::Window::GRAVITY_SOUTH_EAST
    win.move(5, 10)

  # or

    win.gravity= Gdk::Window::GRAVITY_SOUTH_WEST
    win.move(2, Gdk.screen_height - (win.height_request + 2))

  http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk::Window
  http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gdk::Wi...

  - j
Posted by Marc Heiler (shevegen)
on 2011-10-12 05:46
Thank you both a lot!
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.