def __init__(self,title):
super(Frame,self).__init__(None,-1,title,style=wx.DEFAULT_FRAME_STYLE^wx.MAXIMIZE_BOX^wx.RESIZE_BORDER)
self.colors = {0:(204,192,179),2:(238, 228, 218),4:(237, 224, 200),8:(242, 177, 121),16:(245, 149, 99),32:(246, 124, 95),64:(246, 94, 59),128:(237, 207, 114),256:(237, 207, 114),512:(237, 207, 114),1024:(237, 207, 114),2048:(237, 207, 114),4096:(237, 207, 114),8192:(237, 207, 114),16384:(237, 207, 114),32768:(237, 207, 114),65536:(237, 207, 114),131072:(237, 207, 114),262144:(237, 207, 114),524288:(237, 207, 114),1048576:(237, 207, 114),2097152:(237, 207, 114),4194304:(237, 207, 114),8388608:(237, 207, 114),16777216:(237, 207, 114)}#?????????
self.setIcon()
self.initGame()
self.initBuffer()
panel = wx.Panel(self) #??????
#------????
panel.Bind(wx.EVT_KEY_DOWN,self.onKeyDown)
panel.SetFocus() #?????
self.Bind(wx.EVT_SIZE,self.onSize) #use wx.BufferedPaintDC
self.Bind(wx.EVT_PAINT,self.onPaint)
self.Bind(wx.EVT_CLOSE,self.onClose) #????
#------
self.SetClientSize((505,720)) #??????
self.Center() #?????
self.Show()
评论列表
文章目录