Exercise 35.4.2

68 views
Skip to first unread message

zlee

unread,
Oct 13, 2009, 11:29:39 PM10/13/09
to Study-HTDP
Hi all,

Maybe someone can help me.

First, how to get phone-book.ss teachpack?
Second, how to write string to text field? The library functions given
in 22.3 don't have one to write to text field.

There has to be someone who worked this far.

Thanks!
Zhen

Grant Rettke

unread,
Oct 16, 2009, 11:41:43 PM10/16/09
to Study-HTDP
Hi Zhen,

You should post your question here:

http://www.plt-scheme.org/maillist/

There aren't many folks who can answer right now :).

Dave

unread,
Nov 13, 2009, 12:55:54 AM11/13/09
to Study-HTDP
Hi Zhen --

String to text field:

(define a-msg (make-message "Hello"))
(draw-message a-msg "Here is a text message")

draw-message writes a string message (2nd argument) to the gui-item it
accepts as the first argument

If the message were a symbol, you can covert it to a string using the
symbol->string function
(draw-message a-msg (symbol->string 'converted-symbol))

Likewise with a number

(draw-message a-msg (number->string 42))

FYI -- ignore exercise 35.4.2 per MF. The 'connect function is not
available.

Dave Yrueta
Reply all
Reply to author
Forward
0 new messages