[fxruby-users] Problem detecting keypresses in FXTable

dave L dglnz at yahoo.com
Fri Apr 9 21:25:00 EDT 2010

Shouldn't it be FXTable.connect(Fox::SEL_KEYRELEASE) do |sender, selector, event|

I use foxGUIb so if i am wrong i stand corrected to others who know better.



From: Will Parsons <wbparsons at cshore.com>
To: fxruby-users at rubyforge.org
Sent: Sat, 10 April, 2010 8:59:14 AM
Subject: [fxruby-users] Problem detecting keypresses in FXTable

I'm using an RXTable in my application and I would like to be able to
select a row and then press the Delete key to delete the selected row.
This does not seem to work, however, as apparently keypresses are not
initially recognized.  In my FXTable derived class I have:

   connect(SEL_KEYRELEASE) do |sender, selector, event|
      puts "code = #{'%X' % event.code}"
      case event.code
         when KEY_Delete, KEY_KP_Delete
            puts "Delete key hit"
            # process...
         # ...

When I left-click on a row header, the row gets properly selected and
highlighted, but hitting any key does not result in being recognized
(i.e., the messages above do not appear).  If I then click on a table
cell, then subsequent keypresses cause the connected code to fire, and
things work as expected.  Do I have to do something to receive key
events initially?

fxruby-users mailing list
fxruby-users at rubyforge.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100409/6d560c59/attachment.html>

More information about the fxruby-users mailing list