Hi All,

Running Python 3.3.3 / Tk 8.5.15 under MacOSX 10.9.1

I am using a Text widget to display
some text from a file, with 'wrap=WORD' set.

When the file uses both \n and \r in line breaks
(which happens in some Windows files)

The last word of each line is wrapped to the next line.
E.g. text:

 "Mike Krath\n\ris nice." is displayed as

Mike
Krath

is nice.

When editing the text, the widget gets confused
as to where characters are on the screen. Clicking
just past the end of line of "Krath", the insert curser
appears BEFORE the "h".

Try the example below to see if it happens on
your installation:

from tkinter import *
tk = Tk()
fr=Text(tk, wrap=WORD)
fr.pack()
fr.insert(END, "Mike Krath\r\nHigh and Lifted Up\r\nIt was a windy day.")
tk.mainloop()

I could replace all "\n\r" in my text with "\n",
but it would be better for Tk to behave as
expected.

Mick
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to