Browse Source

lazy load of gui

master
Jay McCarthy 1 year ago
parent
commit
745eb82670
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      kitty.rkt

+ 4
- 3
kitty.rkt 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


Loading…
Cancel
Save