Re: Multiple lines in statusbar



Andrew E. Makeev wrote:
Egon Andersen wrote:

Hi,

I've sometime multiple lines of text in the statusbar.
Normally I achieve this by just inserting "\n" in the text-string.
This works fine on Linux, but recently I saw that on Windows I only get a single line and the line-break are shown as the square fallback character.
(I can't tell if it has ever been more than a 'one-liner' on windows.)

I find this behaviour a little strange as the same way of making multiple lines works for e.g. labels on both Linux and Windows.


Linux is using just '\n' (LF = 0xA) character for end of line, but MS Windows - '\r\n' (CR + LF = 0xD + 0xA) characters. Guess, STL lib defines that in std::eol when you are using std::cout, std::cerr output streams.

Well, I'm using C, not C++ ;-)

I know that there are differences between Unix/Linux and Windows on how newline is defined, but "\n" is exactly saying "newline", not how it is implemented on the particular platform.

According to the C-standard (ISO-C99):
<cite>
\n (newline) Moves the active position to the initial position of the next line.
</cite>

And in fact if you open a file in text-mode on Windows, \n is converted to CR+LF - that is one of the ideas behind using "\n" and text-mode.

So I can't really see why "\n" should not be correct when I write a string to the statusbar, just as well as it works correct when it is a label.

And it is a disaster for portability, if "\n" should be "\r\n" on Windows and even something else on Mac.

Best regards
Egon Andersen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]