import sys
import wx

#----------------------------------------------------------------------

class TestPanel(wx.Panel):
    def __init__(self, parent):
        super().__init__(parent, -1)
        self.Bind(wx.EVT_PAINT, self.OnPaint)

    def OnPaint(self, evt):
        dc = wx.PaintDC(self)
        if len(sys.argv) > 1:
            gc = wx.GraphicsContext.Create(dc)

#----------------------------------------------------------------------

class TestFrame(wx.Frame):
    def __init__(self):
        super().__init__(None, -1, size=(550, 440),
                         title='GraphicsContext Test')

        sz1 = wx.BoxSizer(wx.VERTICAL)
        sz2 = wx.BoxSizer(wx.VERTICAL)
        sz2.Add(TestPanel(self), proportion=1, border=0, flag=wx.EXPAND)
        sz1.Add(sz2, proportion=1, border=5, flag=wx.ALL | wx.EXPAND)
        self.SetSizer(sz1)


#----------------------------------------------------------------------

if __name__ == '__main__':
    app = wx.App(False)
    frm = TestFrame()
    frm.Show()
    app.MainLoop()

