From: Lyle Johnson Date: 2003-07-02T22:59:11+09:00 Subject: Re: FXDataTarget not updating my variable Hans Fugal wrote: > But I was under the impression that a datatarget would update the > variable as it was changed. Is that wrong? If not, why is this > happening? Generally speaking, SEL_CHANGED messages are usually sent while a widget's value is changing, and SEL_COMMAND when it is "finished". So, for example, an FXSlider widget will send SEL_CHANGED messages continously to its target while you're dragging the slider back and forth, but will only send SEL_COMMAND to its target when you stop dragging and release the mouse button. In the same way, an FXTextField sends SEL_CHANGED to its target every time the text field's contents changes (e.g. by adding or removing a character), but it only sends SEL_COMMAND when you press or tab out of the text field. So try modifying the previous snippet from this: @datatarget.connect(SEL_COMMAND) do |s,i,data| puts "#{data},#{@name}" end to this: @datatarget.connect(SEL_CHANGED) do |s,i,data| puts "#{data},#{@name}" end and see if you get the result you expected. Hope this helps, Lyle