cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
ben_ph
Level III

Running a TextEditBox's Set Text Changed script programmatically

Is it possible to run a TextEditBox's Set Text Changed script programmatically? I can use << setText("text", runscript(1)) if the TextEditBox's script is set with <<setFunction but not when it is set with <<setTextChanged.

 

 

Names Default To Here(1);
New Window("Example",
    teb = Text Edit Box("Example Text",
        <<Set Text Changed(Function({this, value}, (this << sib) << settext(value)))
    ),
    Text Box("")
);

teb << setText("test", runscript(1)) // Works for <<setFunction

 

Thanks for any help!

 

1 ACCEPTED SOLUTION

Accepted Solutions
ben_ph
Level III

Re: Running a TextEditBox's Set Text Changed script programmatically

This seems to work

Names Default To Here(1);
New Window("Example",
    teb = Text Edit Box("Example Text",
        <<Set Text Changed(Function({this, value}, (this << sib) << settext(value)))
    ),
    Text Box("")
);

teb << setText("abc");
f = teb << getTextChanged();
f(teb, "abc")

View solution in original post

1 REPLY 1
ben_ph
Level III

Re: Running a TextEditBox's Set Text Changed script programmatically

This seems to work

Names Default To Here(1);
New Window("Example",
    teb = Text Edit Box("Example Text",
        <<Set Text Changed(Function({this, value}, (this << sib) << settext(value)))
    ),
    Text Box("")
);

teb << setText("abc");
f = teb << getTextChanged();
f(teb, "abc")