./configure --prefix support for perl
[adesklets.git] / test / test.py
blobca56c95d540d8517810ae42f6960d17750a0d819
1 """
2 test.py - S.Fourmanoit <syfou@users.sourceforge.net>, 2004
4 Small, non-exhaustive adesklets test script:
5 - Resize adesklets window to 100x100 pixels
6 - Put it under wm's control
7 - Set it to be pseudo-transparent
8 - Map it on screen
9 - Then wait until the user exits,
10 generating an alam event every 10 seconds,
11 and catching motion_notify events as they occur
13 To try it:
14 - Install adesklets with python support enabled (default)
15 - Run python test.py from this directory
16 """
17 import adesklets
19 class My_Events(adesklets.Events_handler):
20 def __init__(self):
21 adesklets.Events_handler.__init__(self)
23 def __del__(self):
24 adesklets.Events_handler.__del__(self)
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()
32 def quit(self):
33 print 'Quitting...'
35 def alarm(self):
36 print 'Alarm. Next in 10 seconds.'
37 return 10
39 def motion_notify(self, delayed, x, y):
40 print 'Motion notify:', x, y, delayed
42 My_Events().pause()