Re: Multiple lines in statusbar

2005-04-29 Thread Andrew E. Makeev
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.

-andrew
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Multiple lines in statusbar

2005-04-29 Thread Egon Andersen
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
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Multiple lines in statusbar

2005-04-29 Thread stian
 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.

Did you test it, just to sort out if the issue is the \n not automatically
being translated into \r\n or not.


Stian Skjelstad
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Multiple lines in statusbar

2005-04-29 Thread Egon Andersen
[EMAIL PROTECTED] wrote:
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.

Did you test it, just to sort out if the issue is the \n not automatically
being translated into \r\n or not.
I've just tried to insert \r\n - now I see two squares (fallback 
characters).
So it seems that statusbar on Windows has some problems handling both 
\r and \n!

Best regards
Egon Andersen
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list