开发者

WxHaskell thinks my strings are 1 character long

Whenever I use a string in WxHaskell, it thinks the string is one character (it only displays the first character). It only happens when using the WxHaskell functions, not functions like putStrLn.

For example, the bug happens in this code

module Main where
import Graphics.UI.WX

main = start hello
hello = do f <- frame [text := "Hello"]
           quit <- button f [text := "quit", 开发者_StackOverflow中文版on command := close f]
           set f [layout := widget quit]

It doesn't happen in this program:

module Main where

main = putStrLn "hello"


I had this behavior a while back. Turned out to be a unicode issue. Recompiling with some sort of unicode flag fixed things, IIRC.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜