Hi,
if I add a signal to a Gtk::Box super() doesn’t work like expected. The
following code works:
require ‘gtk3’
class MBox < Gtk::Box
def initialize
super(:vertical)
pack_start Gtk::Label.new(‘bla1’)
pack_start Gtk::Label.new(‘bla2’)
end
end
win = Gtk::Window.new
box = MBox.new
win.add box
win.show_all
Gtk.main
but if I add a new signal:
require ‘gtk3’
class MBox < Gtk::Box
self.type_register
self.signal_new(:value_changed, GLib::Signal::RUN_FIRST,
nil, GLib::Type[‘void’], Float, Float)
def signal_do_value_changed foo, bla
end
def initialize
super(:vertical)
pack_start Gtk::Label.new('bla1')
pack_start Gtk::Label.new('bla2')
end
end
win = Gtk::Window.new
box = MBox.new
win.add box
win.show_all
Gtk.main
I get this error:
box.rb:13:in initialize': wrong argument type Symbol (expected Hash) (TypeError) from box.rb:13:in
initialize’
from box.rb:21:in new' from box.rb:21:in
’
Line 13 is the line with the super call. What I’m doing wrong?
Thanks, detlef