【发布时间】:2011-10-31 04:50:29
【问题描述】:
每当我在 WxHaskell 中使用字符串时,它都会认为该字符串是一个字符(它只显示第一个字符)。它只在使用 WxHaskell 函数时发生,而不是像 putStrLn 这样的函数。
例如,此代码中发生的错误
module Main where
import Graphics.UI.WX
main = start hello
hello = do f <- frame [text := "Hello"]
quit <- button f [text := "quit", on command := close f]
set f [layout := widget quit]
这不会发生在这个程序中:
module Main where
main = putStrLn "hello"
【问题讨论】:
-
在运行这个程序时,我得到一个标题为“Hello”的表单,带有一个标记为“quit”的按钮。
-
这就是我寻求帮助的原因。我看不出有什么问题。我尝试重新安装,但没有成功。