[Xerte] desktop - text entry cursor being shy

Dave Burnett d_b_burnett at hotmail.com
Tue Feb 26 18:22:23 GMT 2013


I am setting up a text entry on a text icon:
teicon.txt.autoSize = 0;teicon.txt._height = 26;teicon.txt._width = 263;//teicon.txt.border = 1;teicon.txt.type = "input";teicon.txt.selectable = 1;teicon.txt.multiline = 0;myTF = new TextFormat();//myTF.font = "Arial";myTF.font = "Arial Bold";myTF.size = 16;teicon.txt.setNewTextFormat(myTF);setFocus(teicon.txt);teicon.txt.text = "";

When this executes, the cursor appears as expected at index 0 and the user starts typing.
A "show answers" routine may pull the focus from that while text is being input (the cursor is in the box).
So I store the existing text and clear the box 
prevtext = teicon.txt.text;teicon.txt.text = "";
Then the user comes back from the subroutine, I set it back up:
teicon.txt.text = prevtext;setFocus(teicon);//Selection.setFocus(teicon); //tried this as well
Which fills the text entry back up, and even accepts keys if I start typing.But no cursor.I need to click the mouse back in the box to get a cursor there again.
Setting the focus puts the cursor there initially, but not the second time around.??   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20130226/4310ee37/attachment.html>


More information about the Xerte mailing list