wx.TextCtrl.GetNumberOfLines() behaves defferent in Linux and Windows

Hi, guys,
When I use GetNumberOfLines() in Windows, I can get the number of
lines with line warp. It means, if I have one sentense in TextCtrl and
it is warped into 2 lines, GetNumberOfLines() returns 2 to me, in
windows. But in Linux, it will return 1.
Dose it have work round for this problem?

Thank you,
Hawk

hawk gao wrote:

Hi, guys,
When I use GetNumberOfLines() in Windows, I can get the number of
lines with line warp. It means, if I have one sentense in TextCtrl and
it is warped into 2 lines, GetNumberOfLines() returns 2 to me, in
windows. But in Linux, it will return 1.
Dose it have work round for this problem?

This is a known difference and although there was at one point a fix for this in wxGTK, it caused more problems than it solved and had to be removed. You can take a look at wx.lib.expando for how I've worked around this in that widget by trying to estimate where the line-wraps would occur.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!