>
> This works as long as there are no newlines within
> self.textbox.GetValue(). If there are, then the insertion point is off
by
> a few locations.
[gazes deeply into his crystal ball]
[looks up and says...]
You are running Windows?
The string returned from the wxTextCtrl has "\r\n" where there are
newlines
in the widget, yes?
It behaves as you'd expect, under wxGTK+... (newlines are "\n").
I think GetValue returns the string with only "\n" on either platform,
however the win32 control uses "\r\n" internally, so this may be where the
discrepancy lies. IOW, SetInsertionPoint is counting positions on lines
with "\r\n" at the end but you are only searching a string with "\n" at the
end of lines.