[wxPython-users] ScrolledMessageDialog error
luisgustavo at petrobras.com.br
luisgustavo at petrobras.com.br
Thu Mar 1 12:42:34 PST 2007
In the program bellow the dialog works for 32 clicks if file contains 1000
lines, 4-5 if it contains 5000 lines, none if it contains 10000.
I believe this dlg is not intended for big strings, but maybe there is a
memory leak somewhere.
Thanks,
Luis
PS: "wxPython in Action" is a great work! Thanks again.
#!/bin/env python
import wx
import wx.lib.dialogs
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "My Frame", size=(300, 300))
panel = wx.Panel(self, -1)
panel.Bind(wx.EVT_LEFT_DOWN, self.OnMove)
wx.StaticText(panel, -1, "Pos:", pos=(10, 12))
self.posCtrl = wx.TextCtrl(panel, -1, "", pos=(40, 10))
file = open('test.out','w')
for i in xrange(1000):
file.writelines('Testing \n testing!')
file.close()
def OnMove(self, event):
pos = event.GetPosition()
self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))
file = open('test.out','r')
s = file.read()
file.close()
dlg = wx.lib.dialogs.ScrolledMessageDialog(self, s, "message test")
dlg.ShowModal()
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show(True)
app.MainLoop()
Robin Dunn
<robin at alldunn.com>
Para
01.03.2007 15:21 wxPython-users at lists.wxwidgets.o
rg
cc
Favor responder a
wxPython-users at lists Assunto
.wxwidgets.org Re: [wxPython-users]
ScrolledMessageDialog error
luisgustavo at petrobras.com.br wrote:
> Friends,
>
> My program is failing when it tries to open a
> ScrolledMessageDialog. The button works sometimes but after this bug it
> won´t. open the dialog again:
>
> Traceback (most recent call last):
> File "C:\svnteste\fouling\runner\fouling.py", line 429, in onExecClick
> dlg = wx.lib.dialogs.ScrolledMessageDialog(self, s, "message test")
> File
> "C:\Python24\lib\site-packages\wx-2.8-msw-unicode\wx\lib\dialogs.py",
line
> 38, in __init__
> style=wx.TE_MULTILINE | wx.TE_READONLY)
> File
"C:\Python24\lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py",
> line 1690, in __init__
> _controls_.TextCtrl_swiginit(self,_controls_.new_TextCtrl(*args,
> **kwargs))
> wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at
> ..\..\src\msw\control.cpp(159) in wxControl::MSWCreateControl():
> CreateWindowEx("EDIT", flags=52211844, ex=00000200) failed
>
> Does anybody have any Idea of what is causing this?
>
Please create a small runnable sample that shows the problem so we can
see exactly what you are trying to do.
http://wiki.wxpython.org/index.cgi/MakingSampleApps
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
"O emitente desta mensagem é responsável por seu conteúdo e endereçamento.
Cabe ao destinatário cuidar quanto ao tratamento adequado. Sem a devida
autorização, a divulgação, a reprodução, a distribuição ou qualquer outra
ação em desconformidade com as normas internas do Sistema Petrobras são
proibidas e passíveis de sanção disciplinar, cível e criminal."
"The sender of this message is responsible for its content and addressing.
The receiver shall take proper care of it. Without due authorization, the
publication, reproduction, distribution or the performance of any other
action not conforming to Petrobras System internal policies and procedures
is forbidden and liable to disciplinary, civil or criminal sanctions."
" El emisor de este mensaje es responsable por su contenido y
direccionamiento. Cabe al destinatario darle el tratamiento adecuado. Sin
la debida autorización, su divulgación, reproducción, distribución o
cualquier otra acción no conforme a las normas internas del Sistema
Petrobras están prohibidas y serán pasibles de sanción disciplinaria, civil
y penal."
More information about the wxpython-users
mailing list