LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   XDrawString and carriage returns (https://www.linuxquestions.org/questions/programming-9/xdrawstring-and-carriage-returns-162335/)

jpbarto 03-25-2004 02:58 PM

XDrawString and carriage returns
 
All, I am writing using XLib to write a little app. And I've been using XDrawString to display text.

However I've come across a situation where I want to display a string with embedded carriage returns:
char *str = "Hello there.\n How are you today?";

However when I display the string using XDrawString the carriage return doesn't translate and the multiple lines get displayed on a single line
ex:
Hello there. How are you today?

instead of:
Hello there.
How are you today?

Can anyone point me to a function that WILL properly display the carriage return, or perhaps is there a different way to encode the carriage return so that XDrawString will planes the lines each on their own line? Or am I stuck breaking the strings apart and displaying them one after the other?

Thanks for any advice,
jpbarto

kev82 03-25-2004 03:07 PM

im not an expert on XLib but with experience from other api's i reckon your gonna have to break it up yourself.


All times are GMT -5. The time now is 05:47 AM.