(use utils gl glu srfi-18) (use qt-light) (define *test-ui* #< Form 0 0 469 301 0 0 0 0 469 301 496 301 Form 130 210 191 41 Exit 100 50 261 71 Oink! 180 160 111 24 Good? 370 200 81 81 EOF ) (define app (qt:init)) (define w (qt:widget *test-ui* #f)) (print w) (define pb (qt:find w "pushButton_2")) (assert pb) (pp pb) (define cb (qt:find w "checkBox")) (assert cb) (pp cb) (define i (qt:pixmap "lisp1pz.png")) (when i (pp (##sys#slot i 1))) (define f #f) (define s (qt:sound "blip.wav")) (pp s) (define r (qt:receiver (lambda () (qt:message "Oink!") (set! (qt:property cb "checked") f) (set! f (not f)) ) ) ) (qt:connect (ensure identity (qt:find w "pushButton_2")) "clicked()" (qt:receiver (lambda () (print "exit") (exit)))) (qt:connect (ensure identity (qt:find w "pushButton")) "clicked()" (qt:receiver (lambda () (qt:play s) (pp (qt:get-open-filename "yo" "."))))) (qt:connect app "aboutToQuit()" (qt:receiver (lambda () (print "about to quit")))) (when i (set! (qt:property (qt:find w "label") "pixmap") i)) (define a 0) (define g (qt:gl "gl" w (cut gl:ClearColor 0 0 0 1) (lambda (w h) (when (zero? h) (set! h 1)) (gl:Viewport 0 0 w h) (gl:MatrixMode gl:PROJECTION) (gl:LoadIdentity) (glu:Ortho2D -1 -1 1 1)) (lambda () (gl:Clear (bitwise-ior gl:COLOR_BUFFER_BIT gl:DEPTH_BUFFER_BIT)) (gl:MatrixMode gl:MODELVIEW) (gl:LoadIdentity) (gl:Rotatef a 0 0 1) (gl:Begin gl:POLYGON) (gl:Vertex2f -0.5 -0.5) (gl:Vertex2f -0.5 0.5) (gl:Vertex2f 0.5 0.5) (gl:Vertex2f 0.5 -0.5) (gl:End) ) ) ) (set! (qt:property g "pos") '#s32(0 0)) (set! (qt:property g "size") '#s32(100 100)) (qt:show w) (qt:show g) (qt:connect app "lastWindowClosed()" (qt:receiver (lambda () (print "closed") (exit)))) (define t (qt:timer 0.01)) (qt:connect t "timeout()" (qt:receiver (lambda () (set! a (+ a 0.3)) (qt:update g) ) ) ) (qt:start t) (qt:run)