wxHaskell labels can't display full text

2019-07-21 10:37发布

I'm testing wxHaskell on Windows XP using the "Hello World" here: http://www.haskell.org/haskellwiki/WxHaskell/Quick_start

But when it runs on my machine, all the text doesn't display. For instance, "Quit" will just display "Q".

Any Ideas?

1条回答
够拽才男人
2楼-- · 2019-07-21 11:36

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.

查看更多
登录 后发表回答