widget-tree sync eventloop - 2
This commit is contained in:
parent
9b58a8ab89
commit
85fb2c868b
|
@ -31,7 +31,8 @@
|
||||||
;; for inits see scgame.scm
|
;; for inits see scgame.scm
|
||||||
|
|
||||||
;; FIXME refactor and cleanup
|
;; FIXME refactor and cleanup
|
||||||
|
;;
|
||||||
|
;; run (widget-tree-eventloop dpy win widget-tree)
|
||||||
|
|
||||||
;; widget tree
|
;; widget tree
|
||||||
|
|
||||||
|
@ -223,18 +224,22 @@
|
||||||
(let ((e (receive channel)))
|
(let ((e (receive channel)))
|
||||||
(cond
|
(cond
|
||||||
((motion-event? e)
|
((motion-event? e)
|
||||||
(set! mousex (motion-event-x))
|
(set! mousex motion-event-x)
|
||||||
(set! mousey (motion-event-y)))
|
(set! mousey motion-event-y))
|
||||||
((map-event? e)
|
((map-event? e)
|
||||||
(map-window dpy win))
|
(map-window dpy map-event-window))
|
||||||
((unmap-event? e)
|
((unmap-event? e)
|
||||||
(unmap-window dpy win))
|
(unmap-window dpy unmap-event-window))
|
||||||
((button-event? e)
|
((button-event? e)
|
||||||
(let ((state button-event-state))
|
(let ((state button-event-state))
|
||||||
(let ((widget (widget-node-collide? widget-tree mousex mouse)))
|
(let ((widget (widget-node-collide? widget-tree mousex mouse)))
|
||||||
(if state
|
(if state
|
||||||
((widget 'press!))
|
((widget 'press!))
|
||||||
((widget 'release!))))))
|
((widget 'release!))))))
|
||||||
|
((expose-event? e)
|
||||||
|
(expose-window dpy expose-event-window))
|
||||||
|
((destroy-widow-event? e)
|
||||||
|
(expose-window dpy destroy-window-event-window))
|
||||||
(else #f))))
|
(else #f))))
|
||||||
(loop))))))
|
(loop))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue