1
只需要一個包裝輸入的文本字段%一個基本的例子如何使用球拍GUI插件包在文本字段中輸入文本
(define blogPost%
(class horizontal-panel%
(super-new)
(define (callback button event)
(define title-new-value (send titleoutput get-value))
(define new-value (send output get-value))
(save title-new-value new-value))
;;(display title-new-value)
;;(display new-value))
(define button (new button% (label "Submit")
(vert-margin 0)
(parent this)
(callback callback)))
(define titleoutput (new text-field% (label " title")
(min-height 20)
(min-width 200)
(parent this)))
(define output (new text-field% (label "blog")
(min-height 450)
(min-width 400)
(stretchable-width 300)
(vert-margin 0)
(parent this)))
))
(define f (new frame% (label "prism blog post GUI") (min-width 400) (min-height 500)))
(define tib (new blogPost%
(parent f)))
(send f show #t)
有更多的這個,基本上它節省了用戶的輸入到我們計劃可以訪問並打印到屏幕的數據庫中。但是,用戶在輸入文本字段時只需在一行中水平輸入,並且不會進行文字換行,並且輸入按鈕不會換行。這個問題是否可以解決?
嘗試運行示例時,出現未綁定的標識符錯誤。 'callback'定義中的'save'是什麼? –