PixInsight Forum (historical)
Software Development => PCL and PJSR Development => Topic started by: mschuster on 2012 September 26 16:23:33
-
TextBox seems to be running in rich text mode.
Basically I have a TextBox t and when I do t.text = "a < b" I get "a b" in the box (2 spaces, no <). When I do t.text = "a < b" (the tag for <) I get "a < b".
Label has a useRichText property, but TextBox does not seem to. Is it possible to turn off rich text in TextBoxes?
Thanks,
Mike
-
Hi Mike,
The TextBox PJSR object is the JavaScript counterpart to pcl::TextBox (http://pixinsight.com/developer/pcl/doc/html/classpcl_1_1TextBox.html), which in turn is a PixInsight console, so it provides the whole functionality of pcl::Console (http://pixinsight.com/developer/pcl/doc/html/classpcl_1_1Console.html).
To disable tag interpretation for a block of text, write it between <raw></raw> tags. For example:
var box = new TextBox;
box.text = "This is <raw>raw text, where you can include < and >.</raw> However, you can't write < in normal text.";
After a <raw> tag, all tags and character entities are ignored (i.e., handled as plain text) except the </raw> tag.