smalltalk texteditor widget print new line
I am using Cincom VisualWorks and开发者_Go百科 using the TextEditor widget. I am able to write data to this widget but for the life of me, I am unable to print new line (or carraige return) characters. Using "cr" as in for "Transcript: cr" doesn't work in this widget. Does anyone know what to do?
There is a method #setText:, and depending on the system you might need CR and LF:
myTextEditorWidget setText: 'line1', Character cr asString, Character lf asString, 'line2'.
if the #setText: method is not defined yet you can do so by adding this as an accessor to the class; say you told the UIBuilder that the text-field has name myText, then you can add the method:
myTextEditorWidget myText: 'line1', Character cr asString, Character lf asString, 'line2'.
精彩评论