add the close-when-hidden? argument to in-terminal
This commit is contained in:
parent
91dd69ba8d
commit
a5d55ff817
|
@ -20,7 +20,8 @@ in command-line scripts.}
|
|||
[#:canvas-min-height canvas-min-height (or/c #f (integer-in 0 10000)) #f]
|
||||
[#:close-button? close-button? boolean? #t]
|
||||
[#:close-label close-label string? (string-constant close)]
|
||||
[#:close-callback close-callback (-> any) void])
|
||||
[#:close-callback close-callback (-> any) void]
|
||||
[#:close-when-hidden? boolean? #t])
|
||||
(is-a?/c terminal<%>)]{
|
||||
|
||||
Creates a GUI, sets up the current error and output ports to
|
||||
|
@ -71,6 +72,11 @@ in command-line scripts.}
|
|||
The @racket[close-callback] function is called after the terminal
|
||||
frame is closed or container is removed.
|
||||
|
||||
When the @racket[container] argument is not @racket[#f], then
|
||||
hiding removing the window from it's frame will abort the
|
||||
computation in the terminal, unless @racket[close-when-hidden?] is @racket[#f].
|
||||
|
||||
|
||||
@history[#:changed "1.4" @elem{Added the @racket[#:close-callback] argument.}]}
|
||||
|
||||
@defparam[on-terminal-run run (-> void?)]{
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
#:canvas-min-height (or/c #f exact-nonnegative-integer?)
|
||||
#:close-button? boolean?
|
||||
#:close-label string?
|
||||
#:close-callback (-> any))
|
||||
#:close-callback (-> any)
|
||||
#:close-when-hidden? boolean?)
|
||||
(is-a?/c terminal<%>))])
|
||||
terminal<%>)
|
||||
|
||||
|
@ -45,7 +46,8 @@
|
|||
#:canvas-min-height [canvas-min-height #f]
|
||||
#:close-button? [close-button? #t]
|
||||
#:close-label [close-button-label (string-constant close)]
|
||||
#:close-callback [user-close-callback void])
|
||||
#:close-callback [user-close-callback void]
|
||||
#:close-when-hidden? [close-when-hidden? #t])
|
||||
(define orig-eventspace (current-eventspace))
|
||||
(define orig-custodian (current-custodian))
|
||||
(define inst-eventspace (if container
|
||||
|
@ -121,8 +123,9 @@
|
|||
(new (class vertical-panel%
|
||||
(super-new)
|
||||
(define/override (on-superwindow-show on?)
|
||||
(unless on?
|
||||
(close-callback))))
|
||||
(when close-when-hidden?
|
||||
(unless on?
|
||||
(close-callback)))))
|
||||
[parent container])))
|
||||
|
||||
(set! text (new (text:hide-caret/selection-mixin text:standard-style-list%)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user