Discussion:
wxTextCtrl truncating on Windows?
(too old to reply)
Colin Barnette
2009-04-28 19:12:10 UTC
Permalink
Hello wx-users!

I have been stuck on a wxPython project for a while, and I am having
trouble finding out just what the trouble is! Let me explain...

I am writing a very simple data editor that opens a file containing a
pickled database-like dict. The dict is parsed and then you can edit the
key/data pairs. The problem arises when I am working in my edit Dialog.
If the data section (a plain multi-line TextCtrl) is too long, it is
truncated. The length of the content though is small, for example I
notice the cutoff at a measly 508 characters! My operating system is
Windows XP.

The source code (html): http://www.colinbarnette.net/code/spyditor.html.
The Python file: http://www.colinbarnette.net/code/spyditor.py
Sample data file: http://www.colinbarnette.net/code/spyder

Apologies for the lack of commenting. I think the culprit is somewhere in
the class EditDialog, as I notice that if I edit the data that is too
large, adding a few characters, then commit the changes by pressing ‘OK’,
immediately the changes are lost as they are not reflected in the main
window nor when you edit the data item again. But honestly the code is so
simple I don’t see how this could be in the code. I am thinking it is some
problem with wxPython or this implementation of wxPython on Windows.

Is it a problem with the pickling? The wxPython? Windows? Any assistance
is greatly appreciated!

Thanks a bunch,

Colin Barnette
Robin Dunn
2009-04-28 19:16:31 UTC
Permalink
Post by Colin Barnette
Hello wx-users!
I have been stuck on a wxPython project for a while, and I am having
trouble finding out just what the trouble is! Let me explain...
I am writing a very simple data editor that opens a file containing a
pickled database-like dict. The dict is parsed and then you can edit
the key/data pairs. The problem arises when I am working in my edit
Dialog. If the data section (a plain multi-line TextCtrl) is too long,
it is truncated. The length of the content though is small, for example
I notice the cutoff at a measly 508 characters! My operating system is
Windows XP.
The source code (html): http://www.colinbarnette.net/code/spyditor.html.
The Python file: http://www.colinbarnette.net/code/spyditor.py
Sample data file: http://www.colinbarnette.net/code/spyder
Apologies for the lack of commenting. I think the culprit is somewhere
in the class EditDialog, as I notice that if I edit the data that is too
large, adding a few characters, then commit the changes by pressing
‘OK’, immediately the changes are lost as they are not reflected in the
main window nor when you edit the data item again. But honestly the
code is so simple I don’t see how this could be in the code. I am
thinking it is some problem with wxPython or this implementation of
wxPython on Windows.
Is it a problem with the pickling? The wxPython? Windows? Any assistance
is greatly appreciated!
You are pulling the data to be edited directly from the list ctrl, and
it does have a limit of how much text it will hold and display per item.
If you instead keep your real data separate from the widgets, and just
give the widgets copies, then you will avoid the size problems.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Loading...