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)
|
||||||
(let ((widget (widget-node-collide? widget-tree mousex mouse)))
|
(map-window dpy win))
|
||||||
((widget 'press!))))
|
((unmap-event? e)
|
||||||
((button-release-event? e)
|
(unmap-window dpy win))
|
||||||
(let ((widget (widget-node-collide? widget-tree mousex mouse)))
|
((button-event? e)
|
||||||
((widget 'press!))))
|
(let ((state button-event-state))
|
||||||
|
(let ((widget (widget-node-collide? widget-tree mousex mouse)))
|
||||||
|
(if state
|
||||||
|
((widget 'press!))
|
||||||
|
((widget 'release!))))))
|
||||||
(else #f))))
|
(else #f))))
|
||||||
(loop))))))
|
(loop))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue