lazy load of gui
This commit is contained in:
parent
46758aa583
commit
745eb82670
|
@ -6,14 +6,12 @@
|
||||||
(prefix-in pict: pict)
|
(prefix-in pict: pict)
|
||||||
file/convertible
|
file/convertible
|
||||||
racket/class
|
racket/class
|
||||||
racket/gui/base)
|
racket/gui/dynamic)
|
||||||
|
|
||||||
(define (convert->png-bytes v)
|
(define (convert->png-bytes v)
|
||||||
(and (convertible? v)
|
(and (convertible? v)
|
||||||
(convert v 'png-bytes+bounds #f)))
|
(convert v 'png-bytes+bounds #f)))
|
||||||
|
|
||||||
(define (snip? v) (is-a? v snip%))
|
|
||||||
|
|
||||||
;; Replace "racket -t file"
|
;; Replace "racket -t file"
|
||||||
;; with
|
;; with
|
||||||
;; "racket -I raart/kitty-init -i -t file -e '(exit 0)'"
|
;; "racket -I raart/kitty-init -i -t file -e '(exit 0)'"
|
||||||
|
@ -24,6 +22,9 @@
|
||||||
|
|
||||||
(define (install-kitty-print!)
|
(define (install-kitty-print!)
|
||||||
(when (term-is-kitty?)
|
(when (term-is-kitty?)
|
||||||
|
(define (snip? v)
|
||||||
|
(and (gui-available?)
|
||||||
|
(is-a? v (gui-dynamic-require 'snip%))))
|
||||||
;; XXX This could do better and use
|
;; XXX This could do better and use
|
||||||
#;(pretty-print-size-hook)
|
#;(pretty-print-size-hook)
|
||||||
;; and
|
;; and
|
||||||
|
|
Loading…
Reference in New Issue