ruby-****@sourc*****
ruby-****@sourc*****
2003年 10月 4日 (土) 04:59:46 JST
------------------------- REMOTE_ADDR = 62.10.89.134 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/it?tut-gtk-helloworld ------------------------- = Ruby/GTK2 Ciao mondo! {{image_right("helloworld.png")}} Questo un comune programma di prova per Ruby/GTK2 che dice "Ciao mondo!". Questo programma anche disponibile nel file "gtk/sample/misc/helloworld.rb" nel pacchetto ruby-gnome2. #!/usr/bin/env ruby =begin helloworld.rb - Ruby/GTK first sample script. Copyright (c) 2002,2003 Ruby-GNOME2 Project Team This program is licenced under the same licence as Ruby-GNOME2. $Id: helloworld.rb,v 1.4 2003/02/01 16:46:22 mutoh Exp $ =end require 'gtk2' Gtk.init 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