-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathTestWrap.py
More file actions
executable file
·35 lines (24 loc) · 772 Bytes
/
Copy pathTestWrap.py
File metadata and controls
executable file
·35 lines (24 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
import wx
class DemoFrame(wx.Frame):
""" This window displays a button """
def __init__(self, title="Micro App"):
wx.Frame.__init__(self, None , -1, title)
btn = wx.Button(self, label="Quit")
btn.Bind(wx.EVT_BUTTON, self.OnQuit )
self.Bind(wx.EVT_CLOSE, self.OnQuit)
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, evt):
print("in OnPaint")
dc = wx.PaintDC(self)
dc.SetBackground(wx.BLUE_BRUSH)
dc.Clear()
dc.SetPen(wx.RED_PEN)
dc.DrawText('Some Text', 20, 20)
def OnQuit(self,Event):
self.Destroy()
if __name__ == "__main__":
app = wx.App(False)
frame = DemoFrame()
frame.Show()
app.MainLoop()