Page 1 of 1

MultilineEditbox and '\n'

Posted: Sat Mar 26, 2011 10:09
by spracle
//----------------------------------------------------------------------------//
void MultiLineEditboxWindowRenderer::onLookNFeelAssigned()
{
assert(d_window != 0);

// ensure window's text has a terminating \n
String text(d_window->getText());
if (text.empty() || text[text.length() - 1] != '\n')
{
text.append(1, '\n');
d_window->setText(text);
}
}

——Why to append '\n' here? Confusing :?: