[fxruby-users] Issue with callback

Roy Sutton roys at mindspring.com
Tue Jul 26 18:36:14 EDT 2005


I'm experiencing an interesting issue with FXRuby 1.2.6 on Windows.  I 
have the following code:

        self.accelTable.addAccel(fxparseAccel("Ctrl-F4"), self, 
FXSEL(SEL_COMMAND, FXApp::ID_LAST+124))
        FXMAPFUNC(SEL_COMMAND, FXApp::ID_LAST+124,          :do_close_file)

Then later:

      def do_close_file(sender, sel, ptr)
           puts(sender);
           puts(sel);
           puts(ptr);
      end

This code always crashes with a segementation fault at puts(ptr);  I 
believe ptr should contain the ID of the message (FXApp::ID_LAST+124).

Also, as long as I'm here...  Is there a 'quicker' or cleaner way to map 
a function to the accelerator table than what I did above?  I couldn't 
any examples on how to do it and really just cobbled that together from 
a hint a saw on a blog somewhere.

Roy



More information about the fxruby-users mailing list