[fxruby-users] FXText and FXDataTarget

Lyle Johnson lyle at lylejohnson.name
Wed Dec 31 15:58:58 EST 2008

On Dec 29, 2008, at 6:34 PM, kwicher wrote:

> I'd like to ask if it is possible to control the length of the text
> displayed in FXText via the FXDataTarget object?
> I tried something like that but it did not work:


If I understand your question correctly, the answer is no.

The FXDataTarget only sends a SEL_CHANGED message in response to  
receiving SEL_CHANGED from some other object. So in your example, the  
block that checks the data length will only get triggered if someone  
tries to edit the text in the FXText window.

Now, the block won't get exercised if you change the FXDataTarget's  
value directly. But if your goal is to limit the length of the text,  
you can presumably (?) just do that check whenever you change the  
value of the data target in the first place.

Hope this helps. Please follow up if I've misunderstood the question.

-- Lyle

More information about the fxruby-users mailing list