Skip to content

Instantly share code, notes, and snippets.

@Miqueas
Created February 17, 2021 23:27
Show Gist options
  • Save Miqueas/536554cc98bf84fc15092b87699474f7 to your computer and use it in GitHub Desktop.
Save Miqueas/536554cc98bf84fc15092b87699474f7 to your computer and use it in GitHub Desktop.
[Ruby + GTK 3] Simple GTK app
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