1- from round_rect import RoundRect
2- from wrappers import *
3- from widget import *
4- from delayed_call import *
5- from animated_property import *
6- import time
7- import animated_property
8-
9- screen = Screen ("Test" , "" , 800 ,600 , color = "#4f4f4f" )
10- Rect (screen ,"bg" ,w = screen .w , h = screen .h , color = "#00007f" )
11- rootWidget = Widget (screen , "Widgets" , w = screen .w , h = screen .h )
12-
13- r = Box (rootWidget , "rr" , 600 , 400 )
14- r .clipCHildren = False
15- r .x = 40
16- r .y = 40
17-
18- slider = Slider (rootWidget , "slider1" , 20 , 200 , 200 , 40 )
19- scroller = Scrollbar (rootWidget , "sb1" , 250 , 100 , 300 , 40 )
20- button = Button (rootWidget , "button" , 250 , 400 , 300 , 40 )
21-
22- image = Image (rootWidget , "image" , "content/Zwei/cursor_big_over_2.png" , x = 40 , y = 40 )
23- #led = LED(rootWidget, "led1", 650, 500)
24- t = Label (rootWidget , "Hello" , x = 40 , y = 40 , size = 400 , font = "Helvetica" )
25- #t = Text(rootWidget, "Hello", x=40, y=40, h=400, font="Helvetica")
26-
27-
28- #r.animate("w", 300, 500, 0, 3000, PING_PONG | SMOOTH)
29- #r.animate("h", 200, 300, 0, 2000, PING_PONG | SMOOTH)
30-
31- image .animate ("w" , 300 , 500 , 0 , 3000 , PING_PONG | SMOOTH )
32- image .animate ("h" , 200 , 300 , 0 , 2000 , PING_PONG | SMOOTH )
33-
34- t .animate ("w" , 300 , 500 , 0 , 3000 , PING_PONG | SMOOTH )
35- t .animate ("h" , 200 , 300 , 0 , 2000 , PING_PONG | SMOOTH )
36-
37-
38- screen .event_handler = rootWidget
39-
40- #pc0 = PeriodicCall(led.toggle, 250)
41-
42- def tick ():
43- animated_property .T = time .time ()* 1000
44- AnimatedProperty .tick ()
45- return True
46-
47- pct = PeriodicCall (tick ,0 )
48-
1+ from round_rect import RoundRect
2+ from wrappers import *
3+ from widget import *
4+ from delayed_call import *
5+ from animated_property import *
6+ import time
7+ import animated_property
8+
9+ screen = Screen ("Test" , "" , 800 ,600 , color = "#4f4f4f" )
10+ Rect (screen ,"bg" ,w = screen .w , h = screen .h , color = "#00007f" )
11+ rootWidget = Widget (screen , "Widgets" , w = screen .w , h = screen .h )
12+
13+ r = Box (rootWidget , "rr" , 600 , 400 )
14+ r .clipCHildren = False
15+ r .x = 40
16+ r .y = 40
17+
18+ slider = Slider (rootWidget , "slider1" , 20 , 200 , 200 , 40 )
19+ scroller = Scrollbar (rootWidget , "sb1" , 250 , 100 , 300 , 40 )
20+ button = Button (rootWidget , "button" , 250 , 400 , 300 , 40 )
21+
22+ image = Image (rootWidget , "image" , "content/Zwei/cursor_big_over_2.png" , x = 40 , y = 40 )
23+ #led = LED(rootWidget, "led1", 650, 500)
24+ t = Label (rootWidget , "Hello" , x = 40 , y = 40 , size = 400 , font = "Helvetica" )
25+ #t = Text(rootWidget, "Hello", x=40, y=40, h=400, font="Helvetica")
26+
27+
28+ #r.animate("w", 300, 500, 0, 3000, PING_PONG | SMOOTH)
29+ #r.animate("h", 200, 300, 0, 2000, PING_PONG | SMOOTH)
30+
31+ image .animate ("w" , 300 , 500 , 0 , 3000 , PING_PONG | SMOOTH )
32+ image .animate ("h" , 200 , 300 , 0 , 2000 , PING_PONG | SMOOTH )
33+
34+ t .animate ("w" , 300 , 500 , 0 , 3000 , PING_PONG | SMOOTH )
35+ t .animate ("h" , 200 , 300 , 0 , 2000 , PING_PONG | SMOOTH )
36+
37+
38+ screen .event_handler = rootWidget
39+
40+ #pc0 = PeriodicCall(led.toggle, 250)
41+
42+ def tick ():
43+ animated_property .T = time .time ()* 1000
44+ AnimatedProperty .tick ()
45+ return True
46+
47+ pct = PeriodicCall (tick ,0 )
48+
4949pyglet .app .run ()
0 commit comments