Mercurial > code > home > repos > light9
annotate lib/goocanvas_compat.py @ 2078:2c48e92ad5d3
make loadtest real enough to cause numbers to change on collector's web view
author | drewp@bigasterisk.com |
---|---|
date | Tue, 24 May 2022 01:21:32 -0700 |
parents | 2d2be076754f |
children |
rev | line source |
---|---|
1058
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
1 from gi.repository import GooCanvas |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
2 |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
3 def Points(pts): |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
4 cp = GooCanvas.CanvasPoints.new(len(pts)) |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
5 for i, (x, y) in enumerate(pts): |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
6 cp.set_point(i, x, y) |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
7 return cp |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
8 |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
9 def polyline_new_line(parent, x0=None, y0=None, x1=None, y1=None, points=None, **props): |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
10 p = GooCanvas.CanvasPolyline() |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
11 p.set_property('parent', parent) |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
12 if x0 is not None or points is not None: |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
13 pts = points or Points([(x0, y0), (x1, y1)]) |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
14 p.set_property('points', pts) |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
15 for k, v in props.items(): |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
16 p.set_property(k, v) |
2d2be076754f
forgot to add goocanvas code
Drew Perttula <drewp@bigasterisk.com>
parents:
diff
changeset
|
17 return p |