lazy load of gui

This commit is contained in:
Jay McCarthy 2019-09-19 09:21:32 -04:00
parent 46758aa583
commit 745eb82670
1 changed files with 4 additions and 3 deletions

View File

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