[fxruby-users] FXTable and Escape key

Tim Smith tsmith at tektone.net
Tue Mar 4 15:17:58 EST 2008


When editing an FXTable item, if you press Escape, your changes are
cancelled.  However, when an item is selected but not being edited, the
table still traps the Escape keypress.  As a result, in the following
code, if you open the dialog and then press Escape, it closes.  But if
you open the dialog, select an item in the table, and then press Escape,
nothing happens.  Is this behavior - trapping Escape when no item is
being edited - desirable?  I would expect the dialog to close in both
cases.

 

Tim Smith

 

require 'fox16'; include Fox

 

app = FXApp.new

main = FXMainWindow.new app, 'Test', :height => 100, :width => 100

button = FXButton.new main, 'open dialog',

  :opts => BUTTON_NORMAL | LAYOUT_CENTER_X | LAYOUT_CENTER_Y

button.connect(SEL_COMMAND) {

  dialog = FXDialogBox.new main, 'Dialog'

 

  table = FXTable.new dialog

  table.setTableSize 2, 2

  table.visibleRows = 2

  table.visibleColumns = 2

 

  table.setItemText 0, 0, 'one'

  table.setItemText 0, 1, 'two'

  table.setItemText 1, 0, 'three'

  table.setItemText 1, 1, 'four'

 

  dialog.execute

}

app.create

main.show PLACEMENT_SCREEN

app.run

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20080304/5cce9740/attachment.html 


More information about the fxruby-users mailing list