Changeset 3814

Show
Ignore:
Timestamp:
12/18/07 07:54:14 (1 year ago)
Author:
ed
Message:

Slight update to the process of capturing the visual state of an object in an attempt to fix the problem with recent wxPython versions returning monochrome bitmaps under OS X.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/ui/uiwx/dPemMixin.py

    r3782 r3814  
    12441244    def getCaptureBitmap(self): 
    12451245        """Returns a bitmap snapshot of self, as it appears in the  
    1246         UI at this moment. 
     1246        UI at this moment. NOTE: recent changes in wxPython may cause 
     1247        the bitmap to be returned as monochrome under OS X. 
    12471248        """ 
    12481249        obj = self.Parent 
     
    12611262        else: 
    12621263            dc = wx.ClientDC(obj) 
     1264        # Make sure that the elements are all current 
     1265        obj.iterateCall("_redraw", dc) 
     1266        #obj._redraw(dc) 
     1267 
     1268        # Suggested as an alternative for OS X 
     1269        if wx.Platform == "__WXMAC__": 
     1270            return dc.GetAsBitmap() 
    12631271        rect = self.GetRect() 
    12641272        bmp = wx.EmptyBitmap(rect.width, rect.height, -1)   # - htReduction) 
     
    12681276        memdc.Blit(0, 0, self.Width, self.Height, dc, 0, offset) 
    12691277        memdc.SelectObject(wx.NullBitmap) 
     1278        memdc.Destroy() 
    12701279        return bmp 
    12711280