[racket] How can I get "data" from list-box% ?

From: zhang peipei (zhangpeipei812 at outlook.com)
Date: Fri Oct 10 10:14:11 EDT 2014

Hello guys:
	I am a noob to racket(of course noob to lisp) and I want to learn it.
I have read a little document about racket language and I start to write some toys.
Here are the code:

#lang racket
(require racket/GUI)
(define main-frame (new frame%
                        [label "main"]))

(define test (new list-box%
                  [label ""]
                  [choices (list "hello" "world")]
                  [columns '("key" "value")]
                  [parent main-frame]
                  [style (list 
                          'variable-columns
                          'single
                          'column-headers
                          'clickable-headers
                          'vertical-label)]))

(send main-frame show #t)
;It shows:
;key    value
;hello
;world
(send test get-string 1)
;Result:
;world

(send test set (list "1" "2" "3") (list "4" "5" "6"))
;It shows
;key value
;1   4
;2   5
;3   6
(send test get-string 1)
;Result
;2

My question is:
How can I get the "value" of the value column in the list-box ?

Best regards!
peipei


Posted on the users mailing list.