Brad Montgomery | 15 Jun 19:31

key press event

Hello all
I am new to fxruby and coming from php-gtk and rubygnome

I can not seem to capture key press events with this code
the code was modified from an online example

ruby 1.8.7, ubuntu 9.04, wxruby2.0.0

nothing is echoed to the command line
i also tried exit in the block and nothing

thanks in advance

include Wx
class MyFrame < Frame
  def initialize
    super(nil, -1, "Test Key Press Event")
    evt_key_down { |ev| puts 'a key was pressed' }
  end

end

class MinimalApp < App
  def on_init
    MyFrame.new.show
  end
end
MinimalApp.new.main_loop

happy coding
   brad
--

-- 
Posted via http://www.ruby-forum.com/.

Gmane