From: Hans Fugal Date: 2003-07-03T02:01:20+09:00 Subject: Re: FXDataTarget not updating my variable Hi Lyle, > Generally speaking, SEL_CHANGED messages are usually sent while a > widget's value is changing, and SEL_COMMAND when it is "finished". I was aware of what you are talking about, and I actually only want it to happen on SEL_COMMAND (when the user presses enter). In that respect it is behaving as I expect (the when), but it is not updating @name like I expected. (the what) I wrote a little test to demonstrate what's happening. As the comment says inline, I expected the datatarget to change the value of the variable, but it does not. (That's what the Fox docs seem to indicate should be happening, at least in my mind.) #!/usr/bin/env ruby require 'fox' include Fox class DataTargetWindow < FXMainWindow def initialize(app) super(app, "Data Targets Test", nil, nil, DECOR_ALL, 20, 20, 200, 100) @foo = "foo" dt = FXDataTarget.new(@foo) vframe = FXVerticalFrame.new(self) frame = FXHorizontalFrame.new(vframe) l = FXLabel.new(frame,"B") l.target = dt l.selector = FXDataTarget::ID_VALUE FXTextField.new(frame,10,dt,FXDataTarget::ID_VALUE) FXButton.new(vframe,"puts").connect(SEL_COMMAND) do # I expected @foo and dt.value to be the same, but they will be # different if the value has changed in the textfield. puts "#{@foo},#{dt.value}" end show end end if __FILE__ == $0 application = FXApp.new("DataTarget", "FoxTest") window = DataTargetWindow.new(application) application.create application.run end -- Hans Fugal | De gustibus non disputandum est. http://hans.fugal.net/ | Debian, vim, mutt, ruby, text, gpg http://gdmxml.fugal.net/ | WindowMaker, gaim, UTF-8, RISC, JS Bach --------------------------------------------------------------------- GnuPG Fingerprint: 6940 87C5 6610 567F 1E95 CB5E FC98 E8CD E0AA D460