Created
February 17, 2021 23:27
-
-
Save Miqueas/536554cc98bf84fc15092b87699474f7 to your computer and use it in GitHub Desktop.
[Ruby + GTK 3] Simple GTK app
This file contains hidden or 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
require "gtk3" | |
app = Gtk::Application.new "com.example.ruby-gtk3", :FLAGS_NONE | |
app.signal_connect :activate do |app| | |
head = Gtk::HeaderBar.new | |
head.visible = true | |
head.title = "Ruby GTK+ 3 example" | |
head.show_close_button = true | |
win = Gtk::ApplicationWindow.new app | |
win.default_width = 600 | |
win.default_height = 400 | |
win.set_titlebar head | |
win.present | |
end | |
puts app.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment