noreply at rubyforge.org
2013-Jan-24 11:42 UTC
[wxruby-development] [ wxruby-Bugs-29701 ] Wrong arg in example xrc_example
Bugs item #29701, was opened at 2013-01-24 11:42
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=218&aid=29701&group_id=35
Category: Incorrect or missing docs
Group: current
Status: Open
Resolution: None
Priority: 3
Submitted By: Taiqing Zhao (ztq56)
Assigned to: Alex Fenton (brokentoy)
Summary: Wrong arg in example xrc_example
Initial Comment:
Line 10-29 from wxruby-ruby19-2.0.1-x86-mingw32\samples\xrc\xrc_example.rb
10 # Basic Frame Class. This creates the dialog window
11 class SimpleFrame < Wx::Frame
12 def initialize()
13 super nil, :title => "Sample", :position => [50, 50],
:size => [300, 300]
14
15 txt = "Choose ''Open Dialog'' from the menu to see a
dialog made with XRC"
16 Wx::StaticText.new self, :label => txt, :position => [20, 20]
17
18 # Create a new menu
19 self.menu_bar = Wx::MenuBar.new
20 menu = Wx::Menu.new
21 menu.append Wx::ID_OPEN, "Open Dialog"
22 menu.append Wx::ID_EXIT, "Quit"
23 menu_bar.append(menu,"File")
24
25 # Assign the menu events
26 evt_menu(Wx::ID_OPEN) { SimpleDialog.new(self).show_modal }
27 evt_menu(Wx::ID_EXIT) { close }
28 end
29 end
It should be "pos" but not "position" on line 13 and line
16.
D:/Ruby193/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-mingw32/lib/wx/keyword_ctors.rb:166:in
`
initialize'': Error initializing #<SimpleFrame:0x2fa1cf8>
(ArgumentError)
: Unknown keyword argument(s) : [:position]
Correct parameters for SimpleFrame.new are:
:id => (Fixnum)
:title => (String)
:pos => (Wxruby2::Point)
:size => (Wxruby2::Size)
:style => (Fixnum)
:name => (String)
from xrc_sample.rb:13:in `initialize''
from xrc_sample.rb:71:in `new''
from xrc_sample.rb:71:in `on_init''
from xrc_sample.rb:76:in `main_loop''
from xrc_sample.rb:76:in `<main>''
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=218&aid=29701&group_id=35