[thuban-Bugs][516] wx.MemoryDC fatal error on MacOSX

thuban-bugs@wald.intevation.org thuban-bugs at wald.intevation.org
Fri Oct 19 15:41:57 CEST 2007


Bugs item #516, was opened at 2007-10-19 15:41
Status: Open
Priority: 3
Submitted By: Didrik Pinte (dpinte)
Assigned to: Nobody (None)
Summary: wx.MemoryDC fatal error on MacOSX 
Resolution: None
Version: None
Category: None


Initial Comment:
When running Thuban on MacOSX compiled with wxPython 2.8, I get the following error : 


macmini:~/thuban/Thuban-1.2.0 did$ /usr/local/bin/python2.5 thuban.py
N'a pu trouver le module initial thubanstart
Une exception non g?r?e a ?t? d?clench?e:
C++ assertion "wxAssertFailure" failed in /BUILD/wxPython-src-2.6.4.0/src/mac/carbon/dc.cpp(1482): Invalid DC
(veuillez faire un rapport ? l'adresse http://thuban.intevation.org/bugtracker.html)

Traceback (most recent call last):
  File "thuban.py", line 35, in <module>
    Thuban.UI.main.main()
  File "/Users/did/thuban/Thuban-1.2.0/Thuban/UI/main.py", line 31, in main
    app = application.ThubanApplication(0)
  File "//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.6-mac-unicode/wx/_core.py", line 7755, in __init__
    self._BootstrapApp()
  File "//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.6-mac-unicode/wx/_core.py", line 7407, in _BootstrapApp
    return _core_.PyApp__BootstrapApp(*args, **kwargs)
  File "/Users/did/thuban/Thuban-1.2.0/Thuban/UI/application.py", line 77, in OnInit
    self.top = self.CreateMainWindow()
  File "/Users/did/thuban/Thuban-1.2.0/Thuban/UI/application.py", line 170, in CreateMainWindow
    size = (600, 400))
  File "/Users/did/thuban/Thuban-1.2.0/Thuban/UI/mainwindow.py", line 128, in __init__
    self.ShowLegend()
  File "/Users/did/thuban/Thuban-1.2.0/Thuban/UI/mainwindow.py", line 826, in ShowLegend
    self.ToggleLegend()
  File "/Users/did/thuban/Thuban-1.2.0/Thuban/UI/mainwindow.py", line 835, in ToggleLegend
    legend.LegendPanel(dialog, None, self)
  File "/Users/did/thuban/Thuban-1.2.0/Thuban/UI/legend.py", line 116, in __init__
    self.scalebarbitmap = ScaleBarBitmap(self, map, mainWindow)
  File "/Users/did/thuban/Thuban-1.2.0/Thuban/UI/legend.py", line 722, in __init__
    textwidth, textheight = dc.GetTextExtent("%d"%0)
  File "//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.6-mac-unicode/wx/_gdi.py", line 3493, in GetTextExtent
    return _gdi_.DC_GetTextExtent(*args, **kwargs)
PyAssertionError: C++ assertion "wxAssertFailure" failed in /BUILD/wxPython-src-2.6.4.0/src/mac/carbon/dc.cpp(1482): Invalid DC

This seems related to the empty wx.MemoryDC created in legend.py. 

I found the same problem here : https://svn.enthought.com/enthought/ticket/710.

Changing the wx.MemoryDC to a wx.ScreenDC works fine. I will test this under Linux and Windows and patch the code if it's ok.


----------------------------------------------------------------------

You can respond by visiting: 
http://wald.intevation.org/tracker/?func=detail&atid=105&aid=516&group_id=6




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)