fixed the wx import signature (got rid of mred:wx^)
cleaned up the splash screen for mzos original commit: 8b0d3da98fbef825798cf4c8460214e6e4d8c115
This commit is contained in:
parent
1dbfec62b5
commit
8d9c4986be
|
@ -1,5 +1,5 @@
|
|||
(unit/sig mred:edit^
|
||||
(import mred:wx^
|
||||
(import [wx : wx^]
|
||||
[mred:constants : mred:constants^]
|
||||
[mred:connections : mred:connections^]
|
||||
[mred:autosave : mred:autosave^]
|
||||
|
|
|
@ -1,58 +1,57 @@
|
|||
|
||||
(unit/sig mred:exit^
|
||||
(import mred:wx^
|
||||
[mred:constants : mred:constants^]
|
||||
[mred:preferences : mred:preferences^]
|
||||
[mred:gui-utils : mred:gui-utils^])
|
||||
(rename (-exit exit))
|
||||
|
||||
(mred:debug:printf 'invoke "mred:exit@")
|
||||
|
||||
(define exit-callbacks '())
|
||||
|
||||
(define insert-exit-callback
|
||||
(lambda (f)
|
||||
(set! exit-callbacks (cons f exit-callbacks))
|
||||
f))
|
||||
|
||||
(define remove-exit-callback
|
||||
(lambda (cb)
|
||||
(set! exit-callbacks
|
||||
(let loop ([cb-list exit-callbacks])
|
||||
(cond
|
||||
[(null? cb-list) ()]
|
||||
[(eq? cb (car cb-list)) (cdr cb-list)]
|
||||
[else (cons (car cb-list) (loop (cdr cb-list)))])))))
|
||||
|
||||
(define run-exit-callbacks
|
||||
(lambda ()
|
||||
(let*-values ([(w capW)
|
||||
(if (eq? wx:platform 'windows)
|
||||
(values "exit" "Exit")
|
||||
(values "quit" "Quit"))]
|
||||
[(message)
|
||||
(string-append "Are you sure you want to "
|
||||
w
|
||||
"?")])
|
||||
(let/ec k
|
||||
(when (mred:preferences:get-preference 'mred:verify-exit)
|
||||
(unless (mred:gui-utils:get-choice
|
||||
message capW "Cancel")
|
||||
(k #f)))
|
||||
(unit/sig mred:exit^
|
||||
(import [wx : wx^]
|
||||
[mred:constants : mred:constants^]
|
||||
[mred:preferences : mred:preferences^]
|
||||
[mred:gui-utils : mred:gui-utils^])
|
||||
(rename (-exit exit))
|
||||
|
||||
(mred:debug:printf 'invoke "mred:exit@")
|
||||
|
||||
(define exit-callbacks '())
|
||||
|
||||
(define insert-exit-callback
|
||||
(lambda (f)
|
||||
(set! exit-callbacks (cons f exit-callbacks))
|
||||
f))
|
||||
|
||||
(define remove-exit-callback
|
||||
(lambda (cb)
|
||||
(set! exit-callbacks
|
||||
(let loop ([cb-list exit-callbacks])
|
||||
(cond
|
||||
[(null? cb-list) #t]
|
||||
[(not ((car cb-list))) #f]
|
||||
[else (loop (cdr cb-list))]))))))
|
||||
|
||||
(define -exit
|
||||
(let*-values ([(exiting?) #f])
|
||||
(opt-lambda ([just-ran-callbacks? #f])
|
||||
(unless exiting?
|
||||
(dynamic-wind
|
||||
(lambda () (set! exiting? #t))
|
||||
(lambda ()
|
||||
(if (or just-ran-callbacks? (run-exit-callbacks))
|
||||
(exit)
|
||||
#f))
|
||||
(lambda () (set! exiting? #f))))))))
|
||||
[(null? cb-list) ()]
|
||||
[(eq? cb (car cb-list)) (cdr cb-list)]
|
||||
[else (cons (car cb-list) (loop (cdr cb-list)))])))))
|
||||
|
||||
(define run-exit-callbacks
|
||||
(lambda ()
|
||||
(let*-values ([(w capW)
|
||||
(if (eq? wx:platform 'windows)
|
||||
(values "exit" "Exit")
|
||||
(values "quit" "Quit"))]
|
||||
[(message)
|
||||
(string-append "Are you sure you want to "
|
||||
w
|
||||
"?")])
|
||||
(let/ec k
|
||||
(when (mred:preferences:get-preference 'mred:verify-exit)
|
||||
(unless (mred:gui-utils:get-choice
|
||||
message capW "Cancel")
|
||||
(k #f)))
|
||||
(let loop ([cb-list exit-callbacks])
|
||||
(cond
|
||||
[(null? cb-list) #t]
|
||||
[(not ((car cb-list))) #f]
|
||||
[else (loop (cdr cb-list))]))))))
|
||||
|
||||
(define -exit
|
||||
(let ([exiting? #f])
|
||||
(opt-lambda ([just-ran-callbacks? #f])
|
||||
(unless exiting?
|
||||
(dynamic-wind
|
||||
(lambda () (set! exiting? #t))
|
||||
(lambda ()
|
||||
(if (or just-ran-callbacks? (run-exit-callbacks))
|
||||
(exit)
|
||||
#f))
|
||||
(lambda () (set! exiting? #f))))))))
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
(unit/sig mred:finder^
|
||||
(import mred:wx^
|
||||
(import [wx : wx^]
|
||||
[mred:constants : mred:constants^]
|
||||
[mred:container : mred:container^]
|
||||
[mred:preferences : mred:preferences^]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
(unit/sig mred:keymap^
|
||||
(import mred:wx^
|
||||
(import [wx : wx^]
|
||||
[mred:constants : mred:constants^]
|
||||
[mred:preferences : mred:preferences^]
|
||||
[mred:exit : mred:exit^]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
(unit/sig mred:panel^
|
||||
(import mred:wx^
|
||||
(import [wx : wx^]
|
||||
[mred:constants : mred:constants^]
|
||||
[mred:container : mred:container^]
|
||||
[mred:canvas : mred:canvas^]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;; need a preference for pconvert
|
||||
|
||||
(unit/sig mred:preferences^
|
||||
(import mred:wx^
|
||||
(import [wx : wx^]
|
||||
[mred:constants : mred:constants^]
|
||||
[mred:exn : mred:exn^]
|
||||
[mred : mred:container^]
|
||||
|
|
Loading…
Reference in New Issue
Block a user