I think I've found why the caret wasn't being displayed when first clicking on a text box. It seems that the following is the cause of the problem :
caretpos = wdg.wselend
It appears that wselstart and wselend is 1 for an empty field, so at line 1589 I have added :
IF caretpos>LEN(str$) THEN caretpos=LEN(str$)
Its not the most efficient (or best) place to do it, but it'll do for now...
I've noticed that DDgui_boxprint returns the height of the caret, but is used elsewhere are the column position... :S
This seems to fix it best
ELSE
LOCAL strleng% = LEN(str$)
IF wdg.wselend>strleng THEN wdg.wselend=strleng
IF wdg.wselstart>strleng THEN wdg.wselstart=strleng
caretpos = wdg.wselend
thank you for finding this! :coke: