Created
June 15, 2015 06:49
-
-
Save anonymous/c53cabbb2e789bb8e157 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
''' | |
ZetCode Ruby GTK tutorial | |
This program centers a window on | |
the screen. | |
Author: Jan Bodnar | |
Website: www.zetcode.com | |
Last modified: May 2014 | |
''' | |
require 'gtk3' | |
class RubyApp < Gtk::Window | |
def initialize | |
super | |
set_title "Center" | |
signal_connect "destroy" do | |
Gtk.main_quit | |
end | |
set_default_size 300, 200 | |
set_window_position Gtk::Window::Position::CENTER | |
show | |
end | |
end | |
Gtk.init | |
window = RubyApp.new | |
Gtk.main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment