/usr/bin/ruby -w /Users/Tim/wxrmc.rb
/Users/Tim/wxrmc.rb:9:in `new'': Error initializing
#<Wx::Frame:0x74ecf8>
(ArgumentError)
: Wrong arguments for overloaded method ''wxFrame.new''.
Possible C/C++ prototypes are:
wxFrame.new()
wxFrame.new(wxWindow *parent, wxWindowID id, wxString const &title,
wxPoint const &pos, wxSize const &size, long style, wxString const
&name)
Correct parameters for Wxruby2::Frame.new are:
:id => (Fixnum)
:title => (String)
:pos => (Wxruby2::Point)
:size => (Wxruby2::Size)
:style => (Fixnum)
:name => (String)
from /Users/Tim/wxrmc.rb:9:in `on_init''
from /Users/Tim/wxrmc.rb:21:in `main_loop''
from /Users/Tim/wxrmc.rb:21
Compilation exited abnormally with code 1 at Wed Jan 14 15:46:45
Thats the error for this line:
@frame = Frame.new(nil, -1, "Ruby Mud Client", DEFAULT_POSITION,
Point.new(300, 875))
of this code:
http://pastie.org/360951
Anyone know what it means by ''Wrong Arguments''? I''m
fairly certain that
those arguments are correct...
--
Posted via http://www.ruby-forum.com/.
Here is your problem @frame = Frame.new(nil, -1, "Ruby Mud Client", DEFAULT_POSITION, Point.new(300, 875)) ^^^^^^^^^^^^^^^^^^^ That actually needs to be Size.new(300,875), or you can just pass [300,875], and that will work as well. On Wed, Jan 14, 2009 at 4:53 PM, Tim Mcd <lists at ruby-forum.com> wrote:> /usr/bin/ruby -w /Users/Tim/wxrmc.rb > /Users/Tim/wxrmc.rb:9:in `new'': Error initializing #<Wx::Frame:0x74ecf8> > (ArgumentError) > : Wrong arguments for overloaded method ''wxFrame.new''. > Possible C/C++ prototypes are: > wxFrame.new() > wxFrame.new(wxWindow *parent, wxWindowID id, wxString const &title, > wxPoint const &pos, wxSize const &size, long style, wxString const > &name) > > Correct parameters for Wxruby2::Frame.new are: > :id => (Fixnum) > :title => (String) > :pos => (Wxruby2::Point) > :size => (Wxruby2::Size) > :style => (Fixnum) > :name => (String) > from /Users/Tim/wxrmc.rb:9:in `on_init'' > from /Users/Tim/wxrmc.rb:21:in `main_loop'' > from /Users/Tim/wxrmc.rb:21 > > Compilation exited abnormally with code 1 at Wed Jan 14 15:46:45 > > Thats the error for this line: > @frame = Frame.new(nil, -1, "Ruby Mud Client", DEFAULT_POSITION, > Point.new(300, 875)) > of this code: > > http://pastie.org/360951 > > Anyone know what it means by ''Wrong Arguments''? I''m fairly certain that > those arguments are correct... > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20090114/0d430b32/attachment.html>
Tim Mcd wrote:> Correct parameters for Wxruby2::Frame.new are: > :id => (Fixnum) > :title => (String) > :pos => (Wxruby2::Point) > :size => (Wxruby2::Size) > :style => (Fixnum) > :name => (String) > from /Users/Tim/wxrmc.rb:9:in `on_init'' > from /Users/Tim/wxrmc.rb:21:in `main_loop'' > from /Users/Tim/wxrmc.rb:21 > >....> Thats the error for this line: > @frame = Frame.new(nil, -1, "Ruby Mud Client", DEFAULT_POSITION, > Point.new(300, 875)) >Check again: you should be passing a Wx::Size here, not a Wx::Point - you''ve already passed in the position with DEFAULT_POSITION. It''s often easier and less error-prone to use named arguments for these constructors: Wx::Frame.new(nil, :title => ''Ruby Mud Client'', :pos => [300, 875] ) The other values will get the defaults eg -1, DEFAULT_POSITION a
Mario Steele wrote:> Here is your problem > > @frame = Frame.new(nil, -1, "Ruby Mud Client", DEFAULT_POSITION, > Point.new(300, 875)) > > ^^^^^^^^^^^^^^^^^^^ > > That actually needs to be Size.new(300,875), or you can just pass > [300,875], > and that will work as well.Hey, thanks you two! I thought that it only put in the Defaults for things you dont specify, and you had to specify in order. -- Posted via http://www.ruby-forum.com/.
Tim Mcd wrote:> Mario Steele wrote: >> Here is your problem >> >> @frame = Frame.new(nil, -1, "Ruby Mud Client", DEFAULT_POSITION, >> Point.new(300, 875)) >> >> ^^^^^^^^^^^^^^^^^^^ >> >> That actually needs to be Size.new(300,875), or you can just pass >> [300,875], >> and that will work as well. > > Hey, thanks you two! I thought that it only put in the Defaults for > things you dont specify, and you had to specify in order.Meep! Now it runs really slowly... Like the inputbar and textview don''t even initialize... -- Posted via http://www.ruby-forum.com/.