Sha256: 2ad028732657095dd81a17614b9b3b267ff24b8fdb5181db41adf7d0ef4de68e
Contents?: true
Size: 903 Bytes
Versions: 6
Compression:
Stored size: 903 Bytes
Contents
# # Based on the 'Upgraded Hello world' Gtk+ tutorial example at # http://library.gnome.org/devel/gtk-tutorial/2.90/x344.html # $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') 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!" GObject.signal_connect win, "delete-event" do Gtk.main_quit false end # FIXME: #border_width= should work win.set_border_width 10 box = Gtk::HBox.new(false, 0) win.add box button = Gtk::Button.new_with_label("Button 1") GObject.signal_connect button, "clicked", "button 1", &callback box.pack_start button, true, true, 0 button.show button = Gtk::Button.new_with_label("Button 2") GObject.signal_connect button, "clicked", "button 2", &callback box.pack_start button, true, true, 0 button.show box.show win.show Gtk.main
Version data entries
6 entries across 6 versions & 1 rubygems