Self.staticBitmap is a wxStaticBitmap, and self.wxBitmap is the same exact image. Wx._core.PyAssertionError: C++ assertion "window->MacGetCGContextRef() != NULL" failed at /BUILD/wxPython-src-3.0.2.0/src/osx/carbon/dcclient.cpp(195) in wxPaintDCImpl(): using wxPaintDC without being in a native paint event _gdi_.BufferedPaintDC_swiginit(self,_gdi_.new_BufferedPaintDC(*args, **kwargs)) This code works just fine on Windows 7, but I keep getting this error when running it on Mac: Traceback (most recent call last):įile "/Users/kyra/Documents/workspace/ADAPT/src/GUI.py", line 1617, in OnPaintĭc = wx.BufferedPaintDC(self.staticBitmap, ())įile "/usr/local/lib/wxPython-3.0.2.0/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_gdi.py", line 5290, in _init_ If ():ĭc.SetPen(wx.Pen(idColor, idThickness))ĭc.DrawLine( 0, rowNum*cellHgt, gridWid, rowNum*cellHgt )ĭc.DrawLine( colNum*cellWid, 0, colNum*cellWid, gridHgt ) def OnPaint(self, event):ĭc = wx.BufferedPaintDC(self.staticBitmap,()) My job is to port this program over from Windows, which it was originally developed on, and make it work on Mac as well but it is a bigger pain the butt than I expected. I'm trying to draw a grid over the image but I just cannot get it to work. In my program I have an image (bitmap) loaded into a wxScrolledWindow.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |