-
-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
Re. Bogdanp/racket-gui-easy#63 (comment).
As the title says, when dragging a slider, threads other than the eventspace thread are suspended. So, the threads in this example end up not running while dragging the slider (or while initiating a drag and holding the slider):
#lang racket/gui
(define f
(new frame%
[label "Test"]))
(define thd
(thread
(lambda ()
(let loop ()
(println `(value ,(thread-receive)))
(loop)))))
(define tick-thd
(thread
(lambda ()
(let loop ()
(println 'tick)
(sleep 1)
(loop)))))
(define timer
(new timer%
[notify-callback
(lambda ()
(println 'timer-tick))]
[interval 1000]))
(define s
(new slider%
[parent f]
[label "Test"]
[init-value 0]
[min-value 0]
[max-value 100]
[callback (lambda (self _event)
(thread-send thd (send self get-value)))]))
(send f show #t)Surprisingly, the timer% doesn't run either.
As a hack, I've tried setting up a display link to post dummy events between drag start and end (the display link is necessary because changed: does not fire if you just hold the slider after dragging), but that doesn't seem to help. Probably the right solution is a run loop source in queue.rkt for the event tracking mode, but I'm not sure how to do that.
Metadata
Metadata
Assignees
Labels
No labels