LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-25-2004, 02:58 PM   #1
jpbarto
Senior Member
 
Registered: Mar 2003
Location: Pittsburgh, PA
Distribution: Gentoo / NetBSD
Posts: 1,251

Rep: Reputation: 45
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
 
Old 03-25-2004, 03:07 PM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding carriage returns Zxarr Programming 7 09-20-2005 05:44 AM
How to remove carriage returns in a bunch of perl scripts? rebel Red Hat 4 04-12-2005 02:27 PM
Carriage Returns Thorkyl Linux - Software 7 06-28-2004 05:42 PM
Kword: How to remove carriage returns? RockyRed Linux - Newbie 1 07-21-2003 06:52 AM
Carriage Returns Trouble sancho5 Linux - General 2 08-29-2001 08:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration