01: """
02: test.py - S.Fourmanoit <syfou@users.sourceforge.net>, 2004
03: 
04: Small, non-exhaustive adesklets test script:
05:         - Resize adesklets window to 100x100 pixels
06:         - Put it under wm's control
07:         - Set it to be pseudo-transparent
08:         - Map it on screen
09:         - Then wait until the user exits,
10:           generating an alam event every 10 seconds,
11:           and catching motion_notify events as they occur
12: 
13: To try it:
14:         - Install adesklets with python support enabled (default)
15:         - Run python test.py from this directory
16: """
17: import adesklets
18: 
19: class My_Events(adesklets.Events_handler):
20:     def __init__(self):
21:         adesklets.Events_handler.__init__(self)
22:         
23:     def __del__(self):
24:         adesklets.Events_handler.__del__(self)
25:         
26:     def ready(self):
27:         adesklets.window_resize(100,100)
28:         adesklets.window_reset(adesklets.WINDOW_MANAGED)
29:         adesklets.window_set_transparency(True)
30:         adesklets.window_show()
31:         
32:     def quit(self):
33:         print 'Quitting...'
34:         
35:     def alarm(self):
36:         print 'Alarm. Next in 10 seconds.'
37:         return 10
38:     
39:     def motion_notify(self, delayed, x, y):
40:         print 'Motion notify:', x, y, delayed
41:         
42: My_Events().pause()