コード例 #1
0
ファイル: Canvas.py プロジェクト: skykooler/Lightningbeam
 def __init__(self, ctx):
     ctx.set_fill_rule(FILL_RULE_EVEN_ODD)
     self._gtk_ctx = ctx
     self._gstack = []
     self._state = GState()
     GCanvas.__init__(self)
     GCanvasPaths.__init__(self)
コード例 #2
0
 def __init__(self, ctx):
     ctx.set_fill_rule(FILL_RULE_EVEN_ODD)
     self._gtk_ctx = ctx
     self._gstack = []
     self._state = GState()
     GCanvas.__init__(self)
     GCanvasPaths.__init__(self)
コード例 #3
0
ファイル: Canvas.py プロジェクト: tomihasa/pygui
 def __init__(self):
     self._ns_path = NSBezierPath.bezierPath()
     self._ns_path.setWindingRule_(NSEvenOddWindingRule)
     self._stack = []
     ctx = NSGraphicsContext.currentContext()
     ctx.setCompositingOperation_(NSCompositeSourceOver)
     GCanvas.__init__(self)
     self._printing = not ctx.isDrawingToScreen()
     self.initgraphics()
コード例 #4
0
 def __init__(self):
     self._ns_path = NSBezierPath.bezierPath()
     self._ns_path.setWindingRule_(NSEvenOddWindingRule)
     self._stack = []
     ctx = NSGraphicsContext.currentContext()
     ctx.setCompositingOperation_(NSCompositeSourceOver)
     GCanvas.__init__(self)
     self._printing = not ctx.isDrawingToScreen()
     self.initgraphics()
コード例 #5
0
ファイル: Canvas.py プロジェクト: tomihasa/pygui
 def lines(self, points):
     #  Due to a memory leak in PyObjC 2.3, we need to be very careful
     #  about the type of object that we pass to appendBezierPathWithPoints_count_.
     #  If 'points' is a numpy array, we convert it to an array.array of type 'f',
     #  else we fall back on iterating over the points in Python.
     #		ns = self._ns_path
     #		ns.moveToPoint_(points[0])
     #		ns.appendBezierPathWithPoints_count_(points, len(points))
     try:
         p = points.flat
     except AttributeError:
         GCanvas.lines(self, points)
     else:
         a = array('f', p)
         ns = self._ns_path
         ns.moveToPoint_(points[0])
         ns.appendBezierPathWithPoints_count_(a, len(points))
コード例 #6
0
ファイル: Canvas.py プロジェクト: skykooler/Lightningbeam
    def lines(self, points):
        #  Due to a memory leak in PyObjC 2.3, we need to be very careful
        #  about the type of object that we pass to appendBezierPathWithPoints_count_.
        #  If 'points' is a numpy array, we convert it to an array.array of type 'f',
        #  else we fall back on iterating over the points in Python.
#		ns = self._ns_path
#		ns.moveToPoint_(points[0])
#		ns.appendBezierPathWithPoints_count_(points, len(points))
        try:
            p = points.flat
        except AttributeError:
            GCanvas.lines(self, points)
        else:
            a = array('f', p)
            ns = self._ns_path
            ns.moveToPoint_(points[0])
            ns.appendBezierPathWithPoints_count_(a, len(points))