[fxruby-users] Fwd: fxRuby: changing icon in TreeItem crashes
lyle at knology.net
Fri Apr 7 08:56:15 EDT 2006
On Apr 7, 2006, at 3:22 AM, Meinrad Recheis wrote:
> this is a common pitfall! (see below msg to ruby-talk). since you
> asked for ideas for the new fxruby api here is a new one: icons should
> maintain a @created state and don't crash but either raise an
> Exception or just call create in such a case.
I've added a feature request about this but it's going to be difficult
or impossible to do without significant changes to the C++ FOX library.
There are numerous places in the C++ code where Jeroen checks to see if
an icon has been created, and if it hasn't, he calls the fxerror()
function. The fxerror() function prints out an error message (e.g.
"Illegal icon specified") and then calls the system's abort() function.
Various people have asked for him to change this mechanism to make it
more flexible. For example, one approach would be to provide a C++ API
to set an error handler function in place of fxerror(), and let FOX
call that function instead. Another obvious one is to have FOX throw
C++ exceptions instead of calling fxerror(). So far Jeroen has chosen
to leave things the way they are.
More information about the fxruby-users