[wxruby-users] Errors with TextCtrl.new!

Alex Fenton alex at pressure.to
Thu Jan 8 13:22:06 EST 2009


Hi

Tim Mcd wrote:
>     frame = Frame.new(nil, -1, "GMC: Incoming").show
>   

You're assigning the return value of show() to the variable frame.
show() returns a boolean true/false.

>     test = TextCtrl.new(frame, -1, "-----Mud stuff here-----",
> Point.new(500, 500), Size.new(500, 500), TE_READONLY)

Now you're passing that variable containing 'true' as the first arg to 
TextCtrl.new

> guimc.rb:8:in `new': Error initializing #<Wx::TextCtrl:0x74e3c0>
> (TypeError)
>  : Expected argument 1 of type wxWindow *, but got TrueClass true
>   in SWIG method 'wxTextCtrl'

so you get this error :)

> Before, I could use a 'Frame' class as the parent window, but now its
> having issues. I've followed it right off of the API docs. Any idea
> whats wrong/how to fix it?

frame = Wx::Frame.new(...)
frame.show
text = Wx::TextCtrl.new(frame, ...)

cheers
a



More information about the wxruby-users mailing list