Site: updated dependencies on devel page.
[adesklets.git] / test / test.pl
blobd25f4e293d8fbc26552194d9d6489da6616db0e3
1 # test.pl - Lucas Brutschy <lbrutschy@users.sourceforge.net>, 2006
3 # Small, non-exhaustive adesklets test script:
4 # - Resize adesklets window to 100x100 pixels
5 # - Set it to be pseudo-transparent
6 # - Draw a translucent light grey rectangle on it
7 # - Map it on screen
8 # - Mark with a red dot the pointer position every time
9 # a user click
11 # To try it:
12 # - Install adesklets with perl support enabled (default)
13 # - Run perl test.py from this directory
15 use strict;
16 use adesklets;
18 adesklets::open_streams();
20 # these are just normal adesklet commands
21 adesklets::window_resize(100,100);
22 adesklets::window_reset(adesklets::WINDOW_UNMANAGED);
23 adesklets::window_set_transparency(1);
24 adesklets::context_set_color(255,255,255,64);
25 adesklets::image_fill_rectangle(5,5,90,90);
26 adesklets::window_show();
28 adesklets::event_loop(ButtonPress=>\&onbutton); # supply a hash of callbacks
29 adesklets::close_streams();
31 sub onbutton
33 my($x,$y) = @_;
34 adesklets::context_set_color(255,0,0,255);
35 adesklets::image_fill_rectangle($x,$y,3,3);