[pygtk] Problem with gtk.TextView in Windows, but not in Linux

Stephen George steve_geo at optusnet.com.au
Sat Dec 11 06:00:14 WST 2010


Hi James,

Tried your program on windows and I could NOT see the problem you are 
describing, to me it worked as expected.


 > This program works flawlessly in Linux, but not in Windows.  In
 > Windows everything works *except* when you hit the Enter key in the
 > TextView.  It does not insert a new line.

And here you are talking about a new line of text and not a newline 
character[1] as a line ending - something that I think is confusing many 
of the other replies.

For me it did insert a new line, .. onto the text view.
Once closing the app, .. I can see the new line in the file also.

It did not matter were the line was inserted at the end of the text or 
somewhere in the middle.

So unless you have changed the source to a working copy since posting 
this message, I'm not sure why you are seeing the behaviour you are seeing..

Just to be sure you were not talking about line endings as the problem, 
I also checked the line endings on the text file, .. under windows they 
were <CR><LF>. I then did a second test and started with a file that had 
linux line endings, modified it in your program, and checked it after 
and ALL line endings had been converted to windows format line endings.

The only thing I found annoying was that there was no cursor in the text 
view, so you had to use mouse to find the correct insert point, and wait 
till the first character came out to check it was were you expected.

 > I'm using the very latest Python plus the very latest PyGTK, Cairo,
 > PyGObject, and GTK+ bundle.
 >
These are the versions when I tested it:

Windows XP Home (in a virtual machine)
Python  version  2.6.6
GTK+    version  2.16.6
pyGTK   version  2.16.0
gobject version  2.20.0
cairo   version  1.8.6

On Windows 7 64bit OS (32 bit python and gtk)
Python  version  2.6.6
GTK+    version  2.22.0
pyGTK   version  2.22.0
gobject version  2.26.0
cairo   version  1.10.8

Steve
--------
[1] - newline  = <CR><LF> on windows, compared to <LF> on linux.



More information about the pygtk mailing list