Anonymous
Anonymous

Reputation: 841

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", on command := close f]
           set f [layout := widget quit]

It doesn't happen in this program:

module Main where

main = putStrLn "hello"

Upvotes: 4

Views: 132

Answers (1)

Conal
Conal

Reputation: 18587

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

Upvotes: 4

Related Questions