4

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"
Anonymous
  • 821
  • 1
  • 5
  • 14
  • 1
    I get a form titled "Hello" with a single button labelled "quit" when running this program. – Rotsor Aug 20 '11 at 17:53
  • That's why I'm asking for help. I can't see what is wrong. I tried reinstalling, but that didn't work. – Anonymous Aug 20 '11 at 23:58

1 Answers1

4

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

Conal
  • 18,517
  • 2
  • 37
  • 40