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'是什么? –