2017-10-16 41 views
0

J'ai ancien code wxPython 2.0:Comment soustraireRegion dans wxPython Phoenix?

region = wx.RegionFromPoints([(0, 0), (w, 0), (w, h), (0, h)]) 
box = wx.RegionFromPoints([(100, 100), (500, 100), (500, 500), (100, 500)]) 
region.SubtractRegion(box) 

maintenant à wxPython 3.0, il ressemble à ceci:

region = wx.Region([(0, 0), (w, 0), (w, h), (0, h)]) 
box = wx.Region([(100, 100), (500, 100), (500, 500), (100, 500)]) 
region.SubtractRegion(box) 

Traceback ressemble à ceci:

Traceback (most recent call last): 
    File "transparent.py", line 22, in OnPaint 
    region.SubtractRegion(box) 
AttributeError: 'Region' object has no attribute 'SubtractRegion' 

Vérification docs Phoenix et il ne ne mentionne rien sur 'SubtractRegion' dans le nouveau wxPython 3.0

Y a-t-il une solution de contournement?

Répondre