[Wxruby-users] wxchoice still doesn''t work

Kevin Smith
Thu, 11 Aug 2005 22:09:06 -0000

Jani Monoses wrote:
> etc/choice.rb Gives this error on linux
> No matching function for overloaded ''wxControlWithItems_Append

Aaaah. Ok. The Choice control in samples/controls/controls.rb works fine.

The apend call on line 13 of samples/etc/choice.rb isn''t working
because
there are four forms of append that are supported by Choice''s
superclass
(ControlWithItems):

	append(String)
	append(String, String)
	append(String, Wx::ClientData)
	append([Strings])

For whatever reason, swig is mapping the second variant, which is
(String, void) in C++ to being (String, String) in Ruby. The sample is
trying to pass a number as the second parameter, so it is failing.

The wx docs only describe two of these variants (the first two).

The right thing to do is probably for us to somehow convince swig to
allow any data type as the second parameter, and use that as the client
data. Early versions of wxRuby (non-swig) had some serious memory
problems with client data. Hopefully we won''t have that problem.

For now, perhaps someone could rework the sample to either not pass a
second parameter to append, or to pass a String instead of a number.

Thanks,

Kevin