I am using a Pwm TextDialog (which inherits from ScrolledText which inherits from Text).
It is being used as a real time status pop-up window. A good deal of the status messages use a carriage return ('\r') at the end of the message as a way of conserving vertical space, i.e. percentage done messages.
If I appendtext() the message raw the carriage return gets translated into a period and the output is quite ugly. Doing a replace() of the '\r' to a '\n' makes for an extremely long status box.
I can't find a way to alter the INSERT point without placing any text as well.
The only solution I can find is to parse the output character by character looking for a '\r' and then doing:
for cur_char in list(text_to_output):
if cr != True and cur_char == '\r'
cr = True
continue
else:
cr = False
if cr == True:
insert(INSERT + " linestart", cur_char)
cr = False
else
insert(INSERT, cur_char)
There must be a more efficient method. Please help.
Thanks,
ampoliros