use wx.GCDC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2006-10-16 20:22:33 +00:00
parent e2e0b76a95
commit 41c4b3ef21

View File

@ -9,17 +9,20 @@ class TestPanel(wx.Panel):
wx.Panel.__init__(self, parent, -1) wx.Panel.__init__(self, parent, -1)
self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_PAINT, self.OnPaint)
txt = "On the Mac these squares should be transparent, if the\n" \ txt = """\
"CoreGraphics option is turned on. " If this build of wxPython includes the new wx.GCDC class (which
if "wxMac" in wx.PlatformInfo: provides the wx.DC API on top of the new wx.GraphicsContext class)
txt += "This build of wxPython\n" \ then these squares should be transparent.
"%s have the CoreGraphics option turned on." \ """
% ("mac-cg" in wx.PlatformInfo and "DOES" or "DOS NOT")
wx.StaticText(self, -1, txt, (20, 20)) wx.StaticText(self, -1, txt, (20, 20))
def OnPaint(self, evt): def OnPaint(self, evt):
dc = wx.PaintDC(self) pdc = wx.PaintDC(self)
try:
dc = wx.GCDC(pdc)
except:
dc = pdc
rect = wx.Rect(0,0, 100, 100) rect = wx.Rect(0,0, 100, 100)
for RGB, pos in [((178, 34, 34), ( 50, 90)), for RGB, pos in [((178, 34, 34), ( 50, 90)),
(( 35, 142, 35), (110, 150)), (( 35, 142, 35), (110, 150)),