-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspeed_test.py
60 lines (33 loc) · 1.14 KB
/
speed_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from graphicsSVG2.Arrow import Arrow
from graphicsSVG2.CustomPolygon import CustomPolygon
from graphicsSVG2.Image import Image
from graphicsSVG2.Rectangle import Rectangle
from graphicsSVG2.Circle import Circle
from graphicsSVG2.Triangle import Triangle
from graphicsSVG2.Line import Line
from graphicsSVG2.NGon import NGon
from graphicsSVG2.Oval import Oval
from graphicsSVG2.roundedRect import RoundedRect
from graphicsSVG2.Text import Text
from graphicsSVG2.Wedge import Wedge
from nicegui import ui
import time
def handle(event, shape):
if event.type == "mousemove":
print("Mouse moved over shape")
elif event.type == "click":
print("Shape clicked")
elif event.type == "mouseenter":
print("Mouse entered shape")
elif event.type == "mouseleave":
print("Mouse left shape")
elif event.type == "mousedown":
print("Mouse down on shape")
elif event.type == "mouseup":
print("Mouse up on shape")
circle = Circle(100, 100, 50, color='red', event_handler=handle)
circle.scale(0.5)
circle.move(50, 50)
shapes = [circle]
image = Image("shapes.svg", shapes)
ui.run()