Making The
window usefull:
Adding a use to our window:
Now add a textbox to the frame by right clicking on it, you'll notice
that you can drag and drop the textbox above or below the button.
(define (display-window)
(display "see, I did it!"))
double click the textbox, and change the Label to "Enter your favorite
animal:", change inital to the default value of "ardvark", and
important: change the "scheme name"
to "animal". we need to know the name to reference it
later. Like so:
While your at it, change the Label for the button to read "All Done!"
or something more aproperate, and change the function name to
"get-animal", which describes what were doing with the window
better. It should should eventually look like this:
(define (get-animal)

(display "see, I did it!"))
click run, type (get-animal) and it should come up as expected.
Of course, the "All Done" button still just prints "Doom Doom
Doom!". get-animal is supposed to be a function, so now we want
the window to dissapear when we hit the all-done button, and then
return whatever the person typed in.