I'm testing wxHaskell on Windows XP using the "Hello World" here: http://www.haskell.org/haskellwiki/WxHaskell/Quick_start
But when开发者_JS百科 it runs on my machine, all the text doesn't display. For instance, "Quit" will just display "Q".
Any Ideas?
You need to ensure that the wxWidgets used to build wxhaskell has Unicode support enabled. I think you can check by running wx-config --libs --unicode.
What I think is happening is that wxWidgets is expecting simple 8 bit chars but is receiving wide 32 bit ones. The zeroes are interpreted as null characters, ie string terminators. Enabling Unicode support gives you a wxWidgets which accepts wide chars. I'm not entirely sure this version of the story is quite accurate, but I do know that Unicode wxWidgets solves the problem.
On most Linux distributions, I imagine, the wxWidgets package already has Unicode support.
On MacOS X, the bundled wxWidgets does have Unicode support but is unfortunately missing some necessary features related to event handling. The easiest way to get a working wxWidgets is through Homebrew ( brew update; brew install wxmac ).
I have never tried wxhaskell on Windows but others have.
精彩评论