我正在尝试使用Ruby1.9.2p180 (2011-02-18) i386-mingw32的wxRuby,并使用this, perhaps outdated, tutorial
这一点:
class MinimalApp < App
def on_init
Frame.new(nil, -1, "GUI Mockup").show()
end
end有效:打开一个空窗口。但是,当我尝试向窗口添加框架时,如下所示:
class MyFrame < Frame
def initialize()
super(nil, -1, 'My Frame Title')
end
end并将"Frame.new(...“要"MyFrame.new“,我得到以下错误:
C:/.../wxTest.rb:8:in `initialize': wrong number of arguments (3 for 0) (ArgumentError)
from C:/.../wxTest.rb:19:in `new'
from C:/.../wxTest.rb:19:in `on_init'
from C:/.../wxTest.rb:24:in `main_loop'
from C:/.../wxTest.rb:24:in `<main>'在这一点上,我有点卡住了。如果有任何建议,我将不胜感激。
发布于 2011-08-03 04:09:02
好的,所以在发帖几秒钟后,我回答了我自己的问题。问题是
MyFrame.new.(nil, -1, "Multipass GUI Mockup").show()设置选项两次或更多。将其更改为
MyFrame.new.show()成功了。
哦!
https://stackoverflow.com/questions/6917912
复制相似问题