[wxruby-users] xml.load_panel

Max Salov lists at ruby-forum.com
Fri Aug 29 06:55:04 EDT 2008


Alex Fenton wrote:
> Max Salov wrote:
>> Hm, 'super()' call raises error in NewPanel#initalize, while in 
>> MainFrame#initialize it works perfectly.
>>
>> c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.7-i386-mswin32/lib/wx/keyword_ctors.rb:180:in 
>> `pre_wx_kwctor_init': wrong # of arguments(0 for 1) (ArgumentError)
>>   from 
>> c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.7-i386-mswin32/lib/wx/keyword_ctors.rb:180:in 
>> `initialize'
>>   
> Hmm, I get the same error with 1.9.7. I had originally tried with the
> current SVN version, which works fine, although I'm not quite sure
> what's changed. Perhaps someone with the latest development version
> could confirm that this is fixed there?
> 
> alex

Hello,

I don't know my new problem is the same, but now I have the following
XRCPanel is generated from xrc-file by xrcise


#Works fine
class NewPanel < XRCPanel
  def initialize parent = nil
    super
  end
end

# puts don't get executed and panel content is not updated at all
# and is not visible
class NewPanel < XRCPanel
  def initialize parent = nil
    super()
    puts 'Hello, World!'
  end
end

#Works fine but 'on_init' is optional
class NewPanel < XRCPanel
  def on_init
    puts "Hello, World!"
  end
end

So, please, what is the correct method?
-- 
Posted via http://www.ruby-forum.com/.


More information about the wxruby-users mailing list