Python/wxPython/Graphics: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<source lang="python" line> | <source lang="python" line="true" highlight="8,13-15"> | ||
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||
import wx | import wx | ||
Revision as of 01:11, 21 March 2019
#!/usr/bin/env python3
import wx
class MyApp(wx.App):
def OnInit(self):
frame = wx.Frame(None, -1, 'Hello World!')
frame.Bind(wx.EVT_PAINT, self.OnPaint)
frame.Show()
self.mainFrame = frame
return True
def OnPaint(self, evt):
dc = wx.PaintDC(self.mainFrame)
dc.DrawLine(10, 10, 200, 10)
if __name__ == '__main__':
app = MyApp()
app.MainLoop()