Ciao a tutti,
ho questo listato in ruby-gtk2 (sono sotto win2000):
codice:
#!/usr/local/bin/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.5 2003/04/01 16:21:19 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
ma quando vado ad eseguirlo mi dà come errore:
(ruby.exe): GLib-GObject-CRITICAL **: gtype.c:2254: initialization assertion fai
led, use g_type_init() prior to this function
d:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/gtk22.so: [BUG] rbgobj_define_class:
Invalid gtype [GrabStatus]
ruby 1.8.2 (2004-12-25) (i386-mswin32)
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
perchè???
P.S. premettendo che ho correttamente installato sia ruby che il runtime gtk2