widget-tree sync eventloop - 2
This commit is contained in:
parent
c4a75d8570
commit
9b58a8ab89
|
@ -209,7 +209,7 @@
|
||||||
;; This is the main loop you call on your window's
|
;; This is the main loop you call on your window's
|
||||||
;; widget tree (see above)
|
;; widget tree (see above)
|
||||||
|
|
||||||
(define (widget-tree-eventloop widget-tree)
|
(define (widget-tree-eventloop dpy win widget-tree)
|
||||||
(let ((mousex 0)
|
(let ((mousex 0)
|
||||||
(mousey 0))
|
(mousey 0))
|
||||||
(init-sync-x-events dpy)
|
(init-sync-x-events dpy)
|
||||||
|
@ -225,12 +225,16 @@
|
||||||
((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)))
|
||||||
((button-press-event? e)
|
((map-event? e)
|
||||||
|
(map-window dpy win))
|
||||||
|
((unmap-event? e)
|
||||||
|
(unmap-window dpy win))
|
||||||
|
((button-event? e)
|
||||||
|
(let ((state button-event-state))
|
||||||
(let ((widget (widget-node-collide? widget-tree mousex mouse)))
|
(let ((widget (widget-node-collide? widget-tree mousex mouse)))
|
||||||
((widget 'press!))))
|
(if state
|
||||||
((button-release-event? e)
|
((widget 'press!))
|
||||||
(let ((widget (widget-node-collide? widget-tree mousex mouse)))
|
((widget 'release!))))))
|
||||||
((widget 'press!))))
|
|
||||||
(else #f))))
|
(else #f))))
|
||||||
(loop))))))
|
(loop))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue