예제 #1
0
파일: Pixmap.py 프로젝트: mnabeelp/PyGUI
	def with_canvas(self, proc):
		NSGraphicsContext.__class__.saveGraphicsState()
		NSGraphicsContext.setCurrentContext_(self._ns_graphics_context)
		try:
			canvas = Canvas()
			proc(canvas)
		finally:
			NSGraphicsContext.__class__.restoreGraphicsState()
예제 #2
0
 def drawRect_(self, ns_rect):
     (l, t), (w, h) = ns_rect
     rect = (l, t, l + w, t + h)
     self.pygui_component.draw(Canvas(), rect)
예제 #3
0
 def with_canvas(self, proc):
     ns_view = self._ns_view
     ns_view.lockFocus()
     proc(Canvas())
     ns_view.unlockFocus()