[plt-scheme] DrScheme Interactions window
Your best bet is to use the GUI teachpack and otherwise
you follow the directions given below.
(module spanish mzscheme
(require (lib "plt-pretty-big.ss" "lang") (lib "gui.ss" "htdp"))
;; --- Connor starts here
;; --- Model
;; String -> String
(define (conjungate word)
"I don't know anything.")
;; --- GUI
(define txt (make-text "hello"))
(define msg (make-message "the result in Spanish"))
;; Event -> Boolean
(define (callback e)
(draw-message msg (conjungate (text-contents txt))))
(define doit (make-button "Conjungate" callback))
;; Event -> Boolean
(define (quit e)
(hide-window the-window))
(define quit-button (make-button "Quit" quit))
(define the-window (create-window (list (list txt msg doit)
(list quit-button))))
;; --- end
)
When you add the module wrapper, go to the MODULE language.
When you use create executable, use the options STAND ALONE and MRED.
Your application will have the name of the module, not the drscheme
name. It will have the DrScheme icon. I don't know how to change this
under Mac 9. Perhaps Matthew or someone else knows. I am a newly
convinced Mac users.
-- Matthias
P.S. When are you getting your OS X box?
On May 8, 2004, at 7:54 PM, Connor Ferguson wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Actually, I'm developing a program that conjugates verbs in Spanish and
> French. I'd need of course to have some way of putting the information
> needed for conjugation (the subject of the sentence and the infinitive
> of
> the verb). I'd also prefer this to run in its own application with a
> name of
> my choice (even if it only looks that way and in reality it is running
> in
> DrScheme). Also remember that I am only working in version 204.
>
> -Connor
>
>>> on 5/8/04 2:38 PM, Matthias Felleisen wrote:
>
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>> Connor, it sounds like you want to create an executable
>> from your UFO game. For simplicity, let's consider a
>> rocket launch instead, modeled with the new animation
>> feature from 207:
>>
>>> (module gamex mzscheme
>>>
>>> (require (lib "plt-pretty-big.ss" "lang") (lib "draw.ss" "htdp"))
>>> ;; ---- Connor started writing here:
>>> (define (where-x t) (+ 20 (* 2 t)))
>>> (define (where-y t) (- 300 (* 1/2 9.8 t t)))
>>>
>>> (start 300 300) ;; create canvas
>>> (big-bang .8 0) ;; clock ticks every .8 of a second, world is a
>>> natural number
>>> (on-tick-event ;; World -> World
>>> (lambda (t)
>>> (draw
>>> (draw-solid-disk (make-posn (where-x t) (where-y t)) 5 'white)
>>> ;; erase old
>>> (draw-solid-disk (make-posn (where-x (+ t 1)) (where-y (+ t
>>> 1))) 5 'red) ;; draw new
>>> produce
>>> (+ t 1))))
>>> ;; ---- That's all
>>> )
>>
>> When you're done developing, wrap it with the three
>> lines that you see above. Make sure the name of the
>> file is gamex.ss. Then select Scheme | Create Executable.
>>
>> You will see a DrScheme-like icon on your finder (file menu)
>> and you can double-click it.
>>
>> -- Matthias
>>
>