wxHaskell labels can't display full text

妖精的绣舞 提交于 2019-12-10 23:30:49

问题


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:


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.



来源:https://stackoverflow.com/questions/6171375/wxhaskell-labels-cant-display-full-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!