wxPython program failing after upgrade

Chris Liechti cliechti at gmx.net
Wed Nov 13 18:54:02 EST 2002


"Blake Garretson" <blakeg at metalink.net> wrote in
news:ut5re93g8s0556 at corp.supernews.com: 

> I upgraded to wxPython 2.3.3.1 using the precompiled win32 binary, and
> now my wx program won't work.  (I previously used 2.3.2.1)  I'm using
> a DC client to draw some graphics, and it fails when it goes to
> refresh the screen.  Here's the error that shows up in a popup dialog:
> 
> """
> c:\projects\wx\src\msw\dcclient.cpp(216): assert "wxFalse" failed:
> wxPaintDC may be created only in EVT_PAINT handler!
> Do you want to stop the program?
> """

i think you need to use a exClientDC outside of the paint method. or in 
other words when an other thread is drawing to the screen.
 
> (By the way, that path doesn't exist on my machine!)

thats normal. the "assert" messages are compiled in so they have the path 
of the source during compilation.

> Then another error gets printed to stderr:
> 
> """
>   File "C:\Python222\Lib\site-packages\wxPython\gdi.py", line 607, in
> DrawText
>     val = apply(gdic.wxDC_DrawText,(self,) + _args, _kwargs)
> OverflowError: long int too large to convert to int
> """

there should be more, like the location of the exception in your program. 
print the values you use at that line. maybe you're realy drawing somwhere 
outside screen and just have not discovered that yet?

> Any ideas what's going on here?

as you said, you have upgraded ;-) the old version of wxPython might be a 
bit more tolerant to bad values at some places. whatever, i have upgraded 
to that version of wx and had to correct some small issues so that it runs 
on the old and new version, but now it runs fine.

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list