[wxPython-users] ScrolledMessageDialog error

luisgustavo at petrobras.com.br luisgustavo at petrobras.com.br
Fri Mar 2 11:20:37 PST 2007


Antonio,

Thanks and sorry for my newbieness in wxPython... I believe I will have to
give a thorough review in code after that!
I solved the dlg problem with Destroy and a limit in the string size.
Do you know if there is a way to show the dialog scrolled to the end of the
text on Windows?

Cheers,
Luis




                                                                           =

             Ant=F3nio Barbosa                                             =
  =

             (GN/dpi) <ab at jn.pt>                                           =

                                                                      Para =

             01.03.2007 18:35             <wxPython-users at lists.wxwidgets. =

                                          org>                             =

                                                                        cc =

              Favor responder a                                            =

             wxPython-users at lists                                  Assunto =

                .wxwidgets.org            RE: [wxPython-users]             =

                                          ScrolledMessageDialog error      =

                                                                           =

                                                                           =

                                                                           =

                                                                           =

                                                                           =

                                                                           =






Hi gustavo
You need to destroy the dialog!

             dlg =3D wx.lib.dialogs.ScrolledMessageDialog(self, s, "message
test")
             dlg.ShowModal()
             dlg.Destroy()

Cheers
AB
-----Mensagem original-----
De: luisgustavo at petrobras.com.br [mailto:luisgustavo at petrobras.com.br]
Enviada: qui 01-03-2007 20:42
Para: wxPython-users at lists.wxwidgets.org
Assunto: Re: [wxPython-users] ScrolledMessageDialog error

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=3D(300, 300))
        panel =3D wx.Panel(self, -1)
        panel.Bind(wx.EVT_LEFT_DOWN,  self.OnMove)
        wx.StaticText(panel, -1, "Pos:", pos=3D(10, 12))
        self.posCtrl =3D wx.TextCtrl(panel, -1, "", pos=3D(40, 10))
        file =3D open('test.out','w')
        for i in xrange(1000):
            file.writelines('Testing \n   testing!')
        file.close()


    def OnMove(self, event):
        pos =3D event.GetPosition()
        self.posCtrl.SetValue("%s, %s" % (pos.x, pos.y))
        file =3D open('test.out','r')
        s =3D file.read()
        file.close()
        dlg =3D wx.lib.dialogs.ScrolledMessageDialog(self, s, "message test=
")
        dlg.ShowModal()

if __name__ =3D=3D '__main__':
    app =3D wx.PySimpleApp()
    frame =3D 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=B4t. open the dialog again:
>
> Traceback (most recent call last):
>   File "C:\svnteste\fouling\runner\fouling.py", line 429, in onExecClick
>     dlg =3D 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=3Dwx.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=3D52211844, ex=3D00000200) 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 =E9 respons=E1vel por seu conte=FAdo e endere=E7=
amento.
Cabe ao destinat=E1rio cuidar quanto ao tratamento adequado. Sem a devida
autoriza=E7=E3o, a divulga=E7=E3o, a reprodu=E7=E3o, a distribui=E7=E3o ou =
qualquer outra
a=E7=E3o em desconformidade com as normas internas do Sistema Petrobras s=
=E3o
proibidas e pass=EDveis de san=E7=E3o disciplinar, c=EDvel 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=F3n, su divulgaci=F3n, reproducci=F3n, distribuci=F3n o
cualquier otra acci=F3n no conforme a las normas internas del Sistema
Petrobras est=E1n prohibidas y ser=E1n pasibles de sanci=F3n disciplinaria,=
 civil
y penal."


---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org


(See attached file: winmail.dat)
---------------------------------------------------------------------
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 =E9 respons=E1vel por seu conte=FAdo e endere=E7=
amento.
Cabe ao destinat=E1rio cuidar quanto ao tratamento adequado. Sem a devida
autoriza=E7=E3o, a divulga=E7=E3o, a reprodu=E7=E3o, a distribui=E7=E3o ou =
qualquer outra
a=E7=E3o em desconformidade com as normas internas do Sistema Petrobras s=
=E3o
proibidas e pass=EDveis de san=E7=E3o disciplinar, c=EDvel 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=F3n, su divulgaci=F3n, reproducci=F3n, distribuci=F3n o
cualquier otra acci=F3n no conforme a las normas internas del Sistema
Petrobras est=E1n prohibidas y ser=E1n pasibles de sanci=F3n disciplinaria,=
 civil
y penal."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: =3D?ISO-8859-1?Q?winmail=3D2Edat?=3D
Type: application/octet-stream
Size: 5501 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20070=
302/98dac931/ISO-8859-1Qwinmail2Edat.obj


More information about the wxpython-users mailing list