[fxruby-users] Multiple feeds to one data target
Lyle Johnson
lyle at lylejohnson.name
Tue Sep 30 21:17:23 EDT 2008
On Sep 26, 2008, at 9:09 PM, Don Wilde wrote:
> Please see extracted example in DATA following __END__. I'm
> constructing a tab page of a block of TextFields plus sliders in
> construct_slider, but I don't have the info-passing correct yet. I
> can trigger the puts with any SEL_COMMAND, but I'm not getting data
> back. I don't get the value from the #{@in_vals[ targ ].value }, nor
> do I get updated screen contents.
I've had to make some substitutions since the code you sent doesn't
run (missing classes VMImage and VMImageFrame), but I think the main
problem is that you never initialized the data target to any
particular value. The main change I made was just to initialize it to
0.5 (arbitrarily picked):
@in_vals = {
:u_1 => FXDataTarget.new(0.5)
}
When I do this, both the text field and the slider start out with this
value, and changing either the text field or slider value updates the
data target's value as expected.
Hope this helps,
Lyle
---
"FXRuby: Create Lean and Mean GUIs with Ruby"
Now available from the Pragmatic Bookshelf!
http://www.pragprog.com/titles/fxruby
More information about the fxruby-users
mailing list