[fxruby-users] SEL_CHANGED event for FXText and FXTextfield
Philippe Lang
philippe.lang at attiksystem.ch
Thu Jan 25 02:50:37 EST 2007
Hi,
I have noticed a small difference between the SEL_CHANGED event of an
FXText and an FXTextfield: in an FXText, the SEL_CHANGED event gets
fired even if the content does not "change", like when the selection
changes. You can test that with the following test program.
I imagine this is no bug at all. But from a "symetry" point of view :),
I was expecting both events to mean the same in two similar widgets. The
equivalent event for an FXText is actually SEL_REPLACED. It took me some
time to figure it out!
Anyway, this is not a big deal at all.
Regards,
Philippe
-----------------------------------------
require 'fox16'
include Fox
class MyWindow < FXMainWindow
def initialize(app)
super(app, "Window", nil, nil, DECOR_ALL, 0, 0, 200, 100)
text_field = FXTextField.new(self, 15)
text_field.text = "1234567890abcd"
text_field.connect(SEL_CHANGED, method(:onTextFieldChange))
text_area = FXText.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y)
text_area.text = "1234567890abcd"
text_area.connect(SEL_CHANGED, method(:onTextAreaChange))
end
def onTextFieldChange(sender, selector, data)
puts "onTextFieldChange"
end
def onTextAreaChange(sender, selector, data)
puts "onTextAreaChange"
end
def create
super
show(PLACEMENT_SCREEN)
end
end
if __FILE__ == $0
application = FXApp.new("Fox", "FXRuby Test")
MyWindow.new(application)
application.create
application.run
end
More information about the fxruby-users
mailing list