On Tue, 25 Sep 2012, Heinrich Apfelmus wrote:
> Henning Thielemann wrote:
>> When switching from wxcore-0.13.2 to GIT HEAD from
>> https://github.com/jodonoghue/wxHaskell the TextCtrl does no longer use a
>> monospaced font. This may be caused by the recent patch commented with
>> "Fix for unexpected TextCtrl behaviour on OS X. This is the equivalent
>> of patch f225d0c on master."
>> I create the text field this way:
>> WX.textCtrl panel [ font := fontFixed, wrap := WrapNone ]
>> In the past TextCtrl always used a monospaced font, but when I entered
>> text at the end of a text field it happened sometimes that the font had no
>> longer fixed width characters. This might be a wxwidgets bug or even a gtk
>> bug. However, now the TextCtrl does not use the monospace font anymore.
> You can use the textCtrlEx function and pass additional style flags to
> it to create text controls with the old behavior. I think the previous
> source code was
> textCtrlEx parent (wxTE_MULTILINE .+. wxTE_RICH2) props
I see. It sounds reasonable, too. Unfortunately switching back to this
line does not work. Even if it would, it would bypass the improvement that
was introduced with the last patch.
There were not many lines that changed, so I tried to revert them one by
one and found that this change caused the problem:
- (\tc -> (textCtrlGetValue tc, \s -> do textCtrlClear tc; textCtrlWriteText tc s)) $
+ (\tc -> (textCtrlGetValue tc, \s -> do textCtrlChangeValue tc s)) $
It may be related to my observation that the textCtrl sometimes chooses a
variable-space font if I enter text at the end of a text Ctrl in an
otherwise mono-spaced text. That is, it seems to be important _how_ a text
Maybe this is even a Wx bug?