scx/scheme/examples/scxev.scm

33 lines
632 B
Scheme
Raw Normal View History

2001-12-04 08:49:07 -05:00
#!/bin/sh
../../scx <<EOF
,batch on
,open xlib
,batch off
(define (scxev)
(let* ((dpy (open-display))
(black (black-pixel dpy))
(white (white-pixel dpy))
(win (create-window (display-default-root-window dpy)
300 200
'event-mask '(all-events)
'background-pixel white))
)
(set-wm-name! win '("scx Event Listener"))
(map-window win)
(let event-loop ()
(display-flush-output dpy)
(let ((e (wait-event dpy)))
(display (event-type e)) (display " Event, Data:\n")
(display (event-args e)) (newline) (newline)
(event-loop))
(close-display dpy))))
(scxev)
,exit
y
EOF