Files
rackedit/main.rkt
T

34 lines
1011 B
Racket

#lang racket/base
(require racket/runtime-path)
(provide rkdt)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Public interface
;;
;; Keep the GUI implementation out of this module. This allows packages to
;; require rackedit in a headless environment without initializing GTK.
;; The GUI is loaded only when rkdt is actually called.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-runtime-path rkdt-gui-path "private/gui.rkt")
(define (rkdt [filename #f]
#:wait? [wait? #f]
#:width [width 900]
#:height [height 650]
#:x [x 100]
#:y [y 100]
#:frame-cb [frame-cb (λ (call-time frame) #t)])
(define gui-rkdt
(dynamic-require rkdt-gui-path 'rkdt))
(gui-rkdt filename
#:wait? wait?
#:width width
#:height height
#:x x
#:y y
#:frame-cb frame-cb))