From: "Stephan Kämper" Date: 2002-03-01T06:38:55+09:00 Subject: FXRuby: Reacting on changing values of FXDataTarget Hi all, I'd like to react on changing values of an FXDataTarget. Say I have the following code (improve it as you see fit...) require "fox" include Fox class FXDataTargetExample < FXMainWindow def initialize( app ) super( app, "Yet another Example", nil, nil, DECOR_ALL, 0, 0, 270, 90, 0, 0 ) font = FXFont.new( app, "courier new", 16 ) @someText = "Ruby tuesday..." @selected = FXDataTarget.new( @someText.size ) @field = FXTextField.new( self, @someText.size+3, nil, 0, JUSTIFY_RIGHT | FRAME_SUNKEN | LAYOUT_SIDE_TOP ) @field.setText( @someText ) @field.disable @field.setFont( font ) @slide = FXSlider.new( self, @selected, FXDataTarget::ID_VALUE, LAYOUT_CENTER_Y | LAYOUT_FIX_WIDTH, 0, 0, 250 ) @slide.setRange( 1, @someText.size ) end def FXDataTargetExample.run application = FXApp.new( "Yet another Example" ) application.init( ARGV ) main = FXDataTargetExample.new( application ) application.create() main.show( PLACEMENT_SCREEN ) application.run() end end if __FILE__ == $0 FXDataTargetExample.run end I'd like to manipulate the displayed text, say put the @selected-th char in @someText in brackets... So after the program starts Ruby tuesday..[.] is displayed in @field. And if the slide is moved to the leftmost position you'd see: [R]uby tuesday... How would I accomplish this?! Thanks for any help & happy rubying! Stephan