-
-
Save enebo/7e2fe7691db26b48dba94b87462dd42d 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
require 'gtk3' | |
button = Gtk::Button.new("Hello World") | |
button.signal_connect("clicked") { | |
puts "Hello World" | |
} | |
window = Gtk::Window.new | |
window.signal_connect("delete_event") { | |
puts "delete event occurred" | |
#true | |
false | |
} | |
window.signal_connect("destroy") { | |
puts "destroy event occurred" | |
Gtk.main_quit | |
} | |
window.border_width = 10 | |
window.add(button) | |
window.show_all | |
Gtk.main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment