Skip to content

Instantly share code, notes, and snippets.

@jacobmischka
Created August 13, 2015 04:55
Show Gist options
  • Save jacobmischka/661dd80a6b0eb51cfedf to your computer and use it in GitHub Desktop.
Save jacobmischka/661dd80a6b0eb51cfedf to your computer and use it in GitHub Desktop.
ruby
#!/usr/bin/ruby
require 'gir_ffi-gtk3'
Gtk.init
win = Gtk::Window.new(:toplevel)
win.title = "Hello World"
win.signal_connect "delete-event" do
Gtk.main_quit
false
end
onclick = lambda { |widget, data|
new_win = Gtk::Window.new
label = Gtk::Label.new("Tweet!")
label.show
new_win.add label
new_win.show
}
button = Gtk::Button.new_with_label("Button")
button.signal_connect "clicked", &onclick
button.show
win.add button
win.show
Gtk.main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment