[racket] GUI Toolkit related---Simple

From: Zee Ken (udaybhasker552009 at gmail.com)
Date: Thu May 1 11:22:37 EDT 2014

Hi,

I just started looking at the Graphical Interface Toolkit provided in the
Racket Documentation.

http://docs.racket-lang.org/gui/windowing-overview.html

There was this example right in the beginning.


(define frame (new frame%
                   [label "Example"]
                   [width 300]
                   [height 300]))

(define msg (new message%
                    [parent frame]
                    [label "No events so far..."]))

(define mystrng "Line1 text.... \n
                 Line2 text.... \n
                 Line3 text.... \n")

(new button% [parent frame]
             [label "Click Me"]
             [callback (lambda (button event)
                  (send msg set-label mystrng))])

(send frame show #t)

When I click on the button *Click Me*, it has to show *mystrng* like when I
use draw-text procedure in a canvas instead it only shows, *Line1 text...* and
the rest doesn't appear.

Menu items:
PLAY
NOTES
EXIT

When click on *NOTES*, it should show *mystrng* and this new menu should
have a *BACK* button that takes me back to the Main Menu when clicked. I am
having a tough time understanding the GUI Toolkit. I am guessing that I
have to use something else instead of *set-label* in the *send* procedure.

Is there a tutorial or a book or a link that gives some examples on this???


Best,
Zeek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140501/7823d0c6/attachment.html>

Posted on the users mailing list.