[Wxruby-users] TaskBarIcon gives Typerror
Alex Fenton
alex at pressure.to
Thu Aug 23 06:14:49 EDT 2007
kazaam wrote:
> the doc tells about set_icon:
> Boolean set_icon(Icon icon, String tooltip)
>
Mario's already given you a good answer, but just as a general hint in
reading the wxRuby docs: - in the argument list, the grey capitalised
first part of each argument (eg "Icon") is the ruby class of the object
that's expected. So if it's "Icon", it wants a Wx::Icon, if it's
"String" it wants a ruby String.
> shutdown.svg is an Icon and next to it comes a string, so it should be right or? But executed I'm always getting this error:
>
Wow, cool, I never knew that wxRuby handled SVG icons. I expect this is
GTK only though..
> ./task.rb:15:in `set_icon': in method 'SetIcon', argument 2 of type 'wxIcon const &' (TypeError)
it's a bit confusing - "argument 2" here means the first argument to
ruby - this is a SWIG idiocy that it reports errors from a C++
perspective...
Though the class reference docs are pretty comprehensive, I know they're
not always that helpful getting an overall idea of how to use a class.
There is an excellent book on wxWidgets programming which used to be
available as a free PDF. Although the examples are in C++, it's got lots
and lots of ideas and detailed discussion of how the wxRuby classes work.
Alex
More information about the wxruby-users
mailing list