Sha256: 1151c0e1c2aa572544a3c207109af179c0031c169bdae66c0d5e1fb9e2e83fc0
Contents?: true
Size: 791 Bytes
Versions: 13
Compression:
Stored size: 791 Bytes
Contents
#!/usr/bin/env ruby # # Based on the 'Upgraded Hello world' Gtk+ tutorial example at # http://library.gnome.org/devel/gtk-tutorial/2.90/x344.html # require 'gir_ffi-gtk3' callback = lambda { |widget, data| puts "Hello again - #{data} was pressed" } Gtk.init win = Gtk::Window.new(:toplevel) win.title= "Hello Buttons!" win.signal_connect "delete-event" do Gtk.main_quit false end win.border_width = 10 box = Gtk::HBox.new(false, 0) win.add box button = Gtk::Button.new_with_label("Button 1") button.signal_connect "clicked", "button 1", &callback box.pack_start button, true, true, 0 button.show button = Gtk::Button.new_with_label("Button 2") button.signal_connect "clicked", "button 2", &callback box.pack_start button, true, true, 0 button.show box.show win.show Gtk.main
Version data entries
13 entries across 13 versions & 1 rubygems