Hi all,
I have created a basic frame and I’m trying to create a MenuBar inside
it but although I have followed the API Documentation instructions I
always get this error.
This is my code
require ‘wx’
include Wx
class MyFrame < Wx::Frame
def initialize
super(nil,-1,‘MinApp’)
@panel = Wx::Panel.new(self)
@menu_bar = Wx::MenuBar.new(
2,
['File','Edit','Help'],
['Open','Save','Exit'],
0)
show
end
end
class MinApp < App
def on_init
frame = MyFrame.new
end
end
MinApp.new.main_loop
And this is the error:
C:/Documentos/Ruby Scripts/Frame_Ivo/lib/Ivo.rb:13:in initialize': wrong # of arguments(4 for 0) (ArgumentError) from C:/Documentos/Ruby Scripts/Frame_Ivo/lib/Ivo.rb:13:in
new’
from C:/Documentos/Ruby Scripts/Frame_Ivo/lib/Ivo.rb:13:in
initialize' from C:/Documentos/Ruby Scripts/Frame_Ivo/lib/Ivo.rb:31:in
new’
from C:/Documentos/Ruby Scripts/Frame_Ivo/lib/Ivo.rb:31:in on_init' from C:/Documentos/Ruby Scripts/Frame_Ivo/lib/Ivo.rb:35:in
main_loop’
from C:/Documentos/Ruby Scripts/Frame_Ivo/lib/Ivo.rb:35:in `’
Thanks in advance for any help
Ivo R.