]> git.saurik.com Git - wxWidgets.git/blame - wxPython/tests/test_gcMemDC.py
compilation fix for Win64 (patch 1690999)
[wxWidgets.git] / wxPython / tests / test_gcMemDC.py
CommitLineData
cbfc9df6
RD
1"""
2Tests using a memory dc (or a buffered dc) as the target of a
3wx.GraphicsContext.
4"""
5
6import wx
7#import os; print "PID:", os.getpid(); raw_input("Press Enter...")
8
9
10class TestPanel(wx.Panel):
11 def __init__(self, *args, **kw):
12 wx.Panel.__init__(self, *args, **kw)
13 self.Bind(wx.EVT_PAINT, self.OnPaint)
14 self.Bind(wx.EVT_SIZE, self.OnSize)
15
16 def OnSize(self, evt):
17 self.Refresh()
18
19 def OnPaint(self, evt):
20 #dc = wx.PaintDC(self)
21 dc = wx.BufferedPaintDC(self)
22 gcdc = wx.GCDC(dc)
23
24 sz = self.GetSize()
25 gcdc.SetBackground(wx.Brush(self.GetBackgroundColour()))
26 gcdc.Clear()
27 gcdc.DrawLine(0, 0, sz.width, sz.height)
28 gcdc.DrawLine(sz.width, 0, 0, sz.height)
29
30
31app = wx.App(False)
32frm = wx.Frame(None, title="GC/MemoryDC")
33pnl = TestPanel(frm)
34frm.Show()
35app.MainLoop()