15 Jun 19:31
key press event
Brad Montgomery <lists <at> ruby-forum.com>
2009-06-15 17:31:49 GMT
2009-06-15 17:31:49 GMT
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/.
RSS Feed