I observed that wx.TextCtrl in MULTILINE sometimes eats characters sent via AppendText or WriteText. When runing the sample below, line 491 will be incomplete on my system. Can anybody confirm this?
Christian
wxpython 2.8.12.1, python 2.7 on windows xp
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wx
class Frame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, size=(500,400))
I observed that wx.TextCtrl in MULTILINE sometimes eats characters sent
via AppendText or WriteText. When runing the sample below, line 491 will
be incomplete on my system. Can anybody confirm this?
Use the wx.TE_RICH style. Without that the native control used for wx.TextCtrl has a fairly small length limit of 32k or 64k bytes, depending on the version of Windows. With one of the RICH styles then it will be around 2**31 bytes.
I observed that wx.TextCtrl in MULTILINE sometimes eats characters sent
via AppendText or WriteText. When runing the sample below, line 491 will
be incomplete on my system. Can anybody confirm this?
Use the wx.TE_RICH style. Without that the native control used for
wx.TextCtrl has a fairly small length limit of 32k or 64k bytes,
depending on the version of Windows. With one of the RICH styles then
it will be around 2**31 bytes.
I am glad to see this solution for a problem I've had for months...
I don't know which message board I had the discussion on, I may look for it.
But there were two "tipping points" where the TextCtrl screwed up the output,
dropping characters and such.
... google search for textctrl and rufus....
(found posting on 10/11/12) - (aside: funny date.)
Yeah, there were hitches around 32000 and 62000 (not a nice even binary like 32768 and 65536),
They also had different characteristics of their screwup.
I'll try the TE_RICH workaround. I call it a workaround because it's undoubtedly a bug
in the TextCtrl.
Rufus
···
On 6/12/2013 1:26 PM, Christian K. wrote:
Am 12.06.13 12:56, schrieb Robin Dunn:
Christian K. wrote:
I observed that wx.TextCtrl in MULTILINE sometimes eats characters sent
via AppendText or WriteText. When runing the sample below, line 491 will
be incomplete on my system. Can anybody confirm this?
Use the wx.TE_RICH style. Without that the native control used for
wx.TextCtrl has a fairly small length limit of 32k or 64k bytes,
depending on the version of Windows. With one of the RICH styles then
it will be around 2**31 bytes.
A while back, I found the TextCtrl.AppendText() drops characters at the 30000 character level and at 62768
character level and it was repeatable and demostrable.
if you modify your test program to use a 4 digit counter, you will find another glitch at line 1029. I think
it will go smoothly after that.
I see 29509 chars and 61740 as the hit points now.
Strange that the character count appears to be different than when I tested it before (I don't remember
what version of python or wxpython I was using....)
You can use len(self.t.GetValue()) before and after the Append to get the number of characters in the control,
and compare it to the count you thought you added.
def OnTimer(self, evt):
invalue = len(self.t.GetValue())
self.t.WriteText('%04d'%(self.counter)+'q'*55+'\n')
outvalue = len(self.t.GetValue())
if (outvalue-invalue) !=60:
print "Hiccup at ",outvalue
self.hiccups += 1
#print self.counter, len(self.t.GetValue())
self.counter += 1
if (self.hiccups>1) or self.counter == 1050:
self.timer.Stop()
···
On 6/12/2013 11:19 AM, Christian K. wrote:
I observed that wx.TextCtrl in MULTILINE sometimes eats characters sent via AppendText or WriteText. When runing the sample below, line 491 will be incomplete on my system. Can anybody confirm this?
Christian
wxpython 2.8.12.1, python 2.7 on windows xp
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wx
class Frame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, size=(500,400))