Hi,
 Could someone tell me the right way to register
a callback in FXRuby? Below you'll find a code 
example that is full of mistakes. I would like to
know how to correct it,why didClick is called
when FoxTest.new is called, and why the app ends
when the button is clicked ( maybe these are all
the same question :0) )

 Any help/good examples would be _really_
appreciated. There was one example I saw in
blade, but I couldn't make it work.

Regards,
Barry
******************************************
require "fox"
    
include Fox
    
    
class FoxTest
    attr_reader :btn, :main
    
    def initialize()
      application = FXApp.new("Test1", "Test1")
      application.init(ARGV)
      main = FXMainWindow.new(application, "First FXRuby", nil, nil,
DECOR_ALL)
      
      btn = FXButton.new(main, "Button1", nil, application)
      
      
      btn.onDefault(btn,FXButton::SEL_CLICKED,self.didClick)
      
      application.create()
      main.show(PLACEMENT_SCREEN)
      application.run()
    end
    
    def didClick()
     puts "clicked me "
    end
        
 end

 FoxTest.new