From 85fb2c868bf896122a4601ebbb3b65c07bc18bd3 Mon Sep 17 00:00:00 2001 From: erana Date: Tue, 17 Jan 2012 15:23:37 +0900 Subject: [PATCH] widget-tree sync eventloop - 2 --- scsh/scgame/scgamewidgets.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scsh/scgame/scgamewidgets.scm b/scsh/scgame/scgamewidgets.scm index 568be8b..0cee01b 100644 --- a/scsh/scgame/scgamewidgets.scm +++ b/scsh/scgame/scgamewidgets.scm @@ -31,7 +31,8 @@ ;; for inits see scgame.scm ;; FIXME refactor and cleanup - +;; +;; run (widget-tree-eventloop dpy win widget-tree) ;; widget tree @@ -223,18 +224,22 @@ (let ((e (receive channel))) (cond ((motion-event? e) - (set! mousex (motion-event-x)) - (set! mousey (motion-event-y))) + (set! mousex motion-event-x) + (set! mousey motion-event-y)) ((map-event? e) - (map-window dpy win)) + (map-window dpy map-event-window)) ((unmap-event? e) - (unmap-window dpy win)) + (unmap-window dpy unmap-event-window)) ((button-event? e) (let ((state button-event-state)) (let ((widget (widget-node-collide? widget-tree mousex mouse))) (if state ((widget 'press!)) ((widget 'release!)))))) + ((expose-event? e) + (expose-window dpy expose-event-window)) + ((destroy-widow-event? e) + (expose-window dpy destroy-window-event-window)) (else #f)))) (loop))))))