move world frame non-resizeable, make window inset precise

svn: r2224
This commit is contained in:
Matthew Flatt 2006-02-14 14:26:44 +00:00
parent 95a7041a3a
commit 077e2e4ffa

View File

@ -143,6 +143,9 @@
;; Number > 0 ;; Number > 0
[define the-delta 1000] [define the-delta 1000]
;; Amount of space around the image in the world window:
(define INSET 5)
;; Number Number Number World -> true ;; Number Number Number World -> true
;; create the visible world (canvas) ;; create the visible world (canvas)
(define (big-bang w h delta world) (define (big-bang w h delta world)
@ -163,19 +166,23 @@
;; shut down the timer when the window is destroyed ;; shut down the timer when the window is destroyed
(send the-time stop) (send the-time stop)
(inner (void) on-close))) (inner (void) on-close)))
(label "DrScheme"))) (label "DrScheme")
(send (stretchable-width #f)
(new (class editor-canvas% (stretchable-height #f)
(style '(no-resize-border))))
(let ([c (new (class editor-canvas%
(super-new) (super-new)
(define/override (on-char e) (define/override (on-char e)
(on-char-proc (send e get-key-code)))) (on-char-proc (send e get-key-code))))
(parent the-frame) (parent the-frame)
(editor txt) (editor txt)
(style '(no-hscroll no-vscroll)) (style '(no-hscroll no-vscroll))
;; this 20 stuff is a hack, for now (horizontal-inset INSET)
(min-width (+ w 20)) (vertical-inset INSET))])
(min-height (+ h 20))) (send c min-client-width (+ w INSET INSET))
focus) (send c min-client-height (+ h INSET INSET))
(send c focus))
(send txt set-cursor (make-object cursor% 'arrow))
(send txt hide-caret #t) (send txt hide-caret #t)
(send the-frame show #t) (send the-frame show #t)
#t) #t)