Does anyone know anything about Graphics.UI.WXCore.Draw.getTextExtent?
It does not work as I expected from the documentation. If the string
you pass in has multiple lines, then it seems to calculate the height
as if there was only one line. The width is correct though.
Maybe related to this, drawText only draws the first line of the
string as well.
And another question: how do I change the colour of drawn text?
Adding options like
[ penColor := ... ]
[ brushColor := ... ]
doesn't seem to have any effect.
This is all using GHC-6.2.2 on a Mac, with wxHaskell-0.9, and (I
From: Arjan van IJzendoorn <afie@cs...> - 2005-10-09 11:45:45
> Does anyone know anything about Graphics.UI.WXCore.Draw.getTextExtent?
> It does not work as I expected from the documentation.
I don't think it can handle multiple lines, you will have to multiply
the line height with the number of lines yourself. The '\n' symbols
in a string are probably simply seen as funny characters. This is
quite common in GUI libraries (unfortunately).
> Maybe related to this, drawText only draws the first line of the
> string as well.
Yes, you will have to draw each line separately and compute the
changing y coordinate yourself. But, of course, with Haskell you will
be able to build a nice abstraction... :-)
> And another question: how do I change the colour of drawn text?
> Adding options like
> [ penColor := ... ]
> [ brushColor := ... ]
> doesn't seem to have any effect.
textColor :: Attr w Color
textBgcolor :: Attr w Color
Get latest updates about Open Source Projects, Conferences and News.