fix `message-box' to use eventspace of parent, if any
This commit is contained in:
parent
caa0026bc2
commit
128fedaceb
|
@ -46,15 +46,19 @@
|
|||
who title message
|
||||
button1 button2 button3
|
||||
parent style close-result
|
||||
check? two-results? check-message))])
|
||||
(if (eq? (current-thread) (wx:eventspace-handler-thread (wx:current-eventspace)))
|
||||
check? two-results? check-message))]
|
||||
[es (if parent
|
||||
(send parent get-eventspace)
|
||||
(wx:current-eventspace))])
|
||||
(if (eq? (current-thread) (wx:eventspace-handler-thread es))
|
||||
;; In the right thread:
|
||||
(go)
|
||||
;; Not in the right thread:
|
||||
(let ([ch (make-channel)])
|
||||
(wx:queue-callback
|
||||
(lambda ()
|
||||
(channel-put ch (call-with-values go list))))
|
||||
(parameterize ([wx:current-eventspace es])
|
||||
(wx:queue-callback
|
||||
(lambda ()
|
||||
(channel-put ch (call-with-values go list)))))
|
||||
(apply values (channel-get ch)))))))
|
||||
|
||||
(define create-message-box/custom
|
||||
|
|
|
@ -221,7 +221,8 @@ The class that implements the dialog provides a @scheme[get-message]
|
|||
@scheme[get-top-level-windows] function.)
|
||||
|
||||
The @racket[message-box] function can be called int a thread other
|
||||
than the current eventspace's handler thread, in which case the
|
||||
than the handler thread of the relevant eventspace (i.e., the eventspace of
|
||||
@racket[parent], or the current eventspace if @racket[parent] is @racket[#f]), in which case the
|
||||
current thread blocks while the dialog runs on the handler thread.}
|
||||
|
||||
@defproc[(message-box/custom [title label-string?]
|
||||
|
@ -305,7 +306,8 @@ The class that implements the dialog provides a @scheme[get-message]
|
|||
@scheme[get-top-level-windows] function.)
|
||||
|
||||
The @racket[message-box/custom] function can be called int a thread
|
||||
other than the current eventspace's handler thread, in which case the
|
||||
other than the handler thread of the relevant eventspace (i.e., the eventspace of
|
||||
@racket[parent], or the current eventspace if @racket[parent] is @racket[#f]), in which case the
|
||||
current thread blocks while the dialog runs on the handler thread.}
|
||||
|
||||
@defproc[(message+check-box [title label-string?]
|
||||
|
|
Loading…
Reference in New Issue
Block a user