printrun-src/printrun/gui/bufferedcanvas.py

changeset 46
cce0af6351f0
parent 15
0bbb006204fc
equal deleted inserted replaced
45:c82943fb205f 46:cce0af6351f0
88 Causes the canvas to be updated. 88 Causes the canvas to be updated.
89 """ 89 """
90 self.Refresh() 90 self.Refresh()
91 91
92 def getWidthHeight(self): 92 def getWidthHeight(self):
93 width, height = self.GetClientSizeTuple() 93 width, height = self.GetClientSize()
94 if width == 0: 94 if width == 0:
95 width = 1 95 width = 1
96 if height == 0: 96 if height == 0:
97 height = 1 97 height = 1
98 return (width, height) 98 return (width, height)
101 # Event handlers 101 # Event handlers
102 # 102 #
103 103
104 def onPaint(self, event): 104 def onPaint(self, event):
105 # Blit the front buffer to the screen 105 # Blit the front buffer to the screen
106 w, h = self.GetClientSizeTuple() 106 w, h = self.GetClientSize()
107 if not w or not h: 107 if not w or not h:
108 return 108 return
109 else: 109 else:
110 dc = wx.BufferedPaintDC(self) 110 dc = wx.BufferedPaintDC(self)
111 self.draw(dc, w, h) 111 self.draw(dc, w, h)

mercurial