This patch to event.i (if it worked correctly!) would fix the problem of event types being returned a fox objects instead of a fixnum matching the constants expected. This patch has the same problem as the previous one in that you must manually move the ''get_event_type'' declaration down to where it belongs once the .cpp files is produced. If someone has pointers on how to fix this I won''t have to submit broken patches. :) I don''t see a lot of examples of what I''m trying to do. So, I have to wonder if I''m just doing this wrong. Are we supposed to override default functions with hand-crafted ones to get ruby funtionality or are we supposed to do something else? Some feedback on the direction of these patches would be great. Roy _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Roy Sutton wrote:> This patch to event.i (if it worked correctly!) would fix the problem of > event types being returned a fox objects instead of a fixnum matching > the constants expected.Hi Roy! Again, the solution lies not in hand-coding c/c++ but rather in working with swig. "Feel the SWIG. Become one with the SWIG." In this case, swig had no idea what a WXTYPE was, so it assumed it was probably a class. The fix was to add a typedef to swig/typedefs.i so swig knows that a WXTYPE is just a short int. I''ve checked that change in, so Event#get_event_type should work as expected now. Thanks, Kevin
Learn I shall. Feel the swig, I must. Hand-coding to the dark side leads, yes, yes. This is exactly the kind of feedback I needed. I can pick out the problems but I''m still completely new to swig. A few more iterations and we''ll be there. Roy Kevin Smith wrote:> Roy Sutton wrote: > >> This patch to event.i (if it worked correctly!) would fix the problem >> of event types being returned a fox objects instead of a fixnum >> matching the constants expected. > > > Hi Roy! Again, the solution lies not in hand-coding c/c++ but rather > in working with swig. "Feel the SWIG. Become one with the SWIG." > > In this case, swig had no idea what a WXTYPE was, so it assumed it was > probably a class. The fix was to add a typedef to swig/typedefs.i so > swig knows that a WXTYPE is just a short int. > > I''ve checked that change in, so Event#get_event_type should work as > expected now. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >