Code: Alles auswählen
#!/bin/env python
import wx
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Gimp Basics', size=(300, 300))
self.dc = wx.PaintDC(self)
wx.EVT_PAINT(self, self.OnPaint)
self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown)
def OnPaint(self, event=None):
self.dc.BeginDrawing()
self.dc.SetBackground( wx.Brush("White") )
self.dc.EndDrawing()
def OnMouseDown(self,event):
self.dc.BeginDrawing()
self.dc.SetPen(wx.Pen("BLACK", 1))
self.dc.DrawLabel('We can do it',(40,40,20,20))
self.dc.EndDrawing()
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = MyFrame()
frame.Show(True)
app.MainLoop()