Thread: Re: [Dev-C++] Setting text colour
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Damien A. <g_...@ho...> - 2003-04-12 10:54:21
|
<html><div style='background-color:'><DIV> <P><BR><BR></P></DIV> <DIV></DIV><BR><BR>Take a look at the conio.h header file in the Dev-C++ include directory. There are functions in there for console text formatting. Make sure to include the conio.c as an additional command while calling the compiler or simple include it instead of conio.h.<BR> <DIV></DIV> <DIV></DIV> <P>Original G <IMG height=12 src="http://graphics.hotmail.com/emthup.gif" width=12> <IMG height=12 src="http://graphics.hotmail.com/emthup.gif" width=12></P> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>----Original Message Follows---- <DIV></DIV>From: "Dany P. Wu" <DA...@QU...> <DIV></DIV>To: <DEV...@LI...> <DIV></DIV>Subject: [Dev-C++] Setting text colour <DIV></DIV>Date: Sat, 12 Apr 2003 21:06:17 +1200 <DIV></DIV><mailto:dev...@li...?subject=help><mailto:dev...@li...><mailto:dev...@li...?subject=subscribe><mailto:dev...@li...?subject=unsubscribe> <DIV></DIV> <DIV></DIV>Hi everyone, <DIV></DIV> <DIV></DIV>I'm just writing console programs at the moment, and was wondering if <DIV></DIV>there's a way of setting foreground and background colour of text? Is <DIV></DIV>this possible using standard C++ libraries? <DIV></DIV> <DIV></DIV> <DIV></DIV>Cheers, <DIV></DIV>Dany. <DIV></DIV> <DIV></DIV>-- <DIV></DIV>This mail is a natural product. The slight variations in <DIV></DIV>spelling and grammar enhance its individual character and <DIV></DIV>beauty and in no way are to be considered flaws or defects. <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>------------------------------------------------------- <DIV></DIV>This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger <DIV></DIV>for complex code. Debugging C/C++ programs can leave you feeling lost and <DIV></DIV>disoriented. TotalView can help you find your way. Available on major UNIX <DIV></DIV>and Linux platforms. Try it free. www.etnus.com <DIV></DIV>_______________________________________________ <DIV></DIV>Dev-cpp-users mailing list <DIV></DIV>Dev...@li... <DIV></DIV>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm <DIV></DIV>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></mailto:dev...@li...?subject=unsubscribe></mailto:dev...@li...?subject=subscribe></mailto:dev...@li...></mailto:dev...@li...?subject=help></div><br clear=all><hr>The new <a href="http://g.msn.com/8HMZEN/2737">MSN 8:</a> smart spam protection and 2 months FREE* </html> |
|
From: Louis G. <lg...@ya...> - 2003-04-12 15:24:00
|
Damien,
Thank You, I compiled and ran your example under the DevC++ IDE.
It works wery well. It seems that some of the DevC++ C experts
are unaware of this.
I suspect you also know how to change fonts as well. An example of
this would also help many of us who are told this can't be done.
From: "Damien Alleyne" <g_...@ho...>
Subject: Re: [Dev-C++] Setting text colour Date: Sat, 12 Apr 2003
09:20:05 -0400
Well Louis,
I was surprised by so many people saying that it couldn't be done
anymore.
The last time I did text colouring was last year. Anyway, this sample
works on my
system which is a P4 running WinXP. It worked when I was runing WinME.
Tell me if It works on your system.
#include <conio.c>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
printf("Hmmmm. Lets try to change these colors up.\n");
textcolor(YELLOW);
printf("This line should be blue\n");
textcolor(RED);
printf("This line should be red.\n");
printf("Anyway. Later Guys\n");
system("PAUSE");
return 0;
}
--- Damien Alleyne <g_...@ho...> wrote:
---------------------------------
Take a look at the conio.h header file in the Dev-C++ include directory.
There are functions in there for console text formatting. Make sure to
include the conio.c as an additional command while calling the compiler or
simple include it instead of conio.h.
Original G
----Original Message Follows---- From: "Dany P. Wu" To: Subject: [Dev-C++]
Setting text colour Date: Sat, 12 Apr 2003 21:06:17 +1200 Hi everyone, I'm
just writing console programs at the moment, and was wondering if there's
a way of setting foreground and background colour of text? Is this
possible using standard C++ libraries? Cheers, Dany. -- This mail is a
natural product. The slight variations in spelling and grammar enhance its
individual character and beauty and in no way are to be considered flaws
or defects. ------------------------------------------------------- This
SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for
complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
_______________________________________________ Dev-cpp-users mailing list
Dev...@li... TO UNSUBSCRIBE:
http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
---------------------------------
The new MSN 8: smart spam protection and 2 months FREE*
-------------------------------------------------------This SF.net email
is sponsored by: Etnus, makers of TotalView, The debugger for complex
code. Debugging C/C++ programs can leave you feeling lost and disoriented.
TotalView can help you find your way. Available on major UNIX and Linux
platforms. Try it free.
www.etnus.com_______________________________________________Dev-cpp-users
mailing lis...@li... UNSUBSCRIBE:
http://www.noicys.cjb.net/devcpp/ub.htmhttps://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
|
|
From: Per W. <pw...@ia...> - 2003-04-12 18:40:33
|
No, of course we know how to set colors for text output. It's just that
there is no STANDARD library functions for doing it. The conio package is
definitely not standard, so you can't just move your code to another
compiler and/or operating system and expect it to work.
We can hardly avoid knowing about the conio package since this list has
questions about it every 2-4 weeks.
/Per W
On Sat, 12 Apr 2003, Louis Godio wrote:
> Damien,
> Thank You, I compiled and ran your example under the DevC++ IDE.
> It works wery well. It seems that some of the DevC++ C experts
> are unaware of this.
> I suspect you also know how to change fonts as well. An example of
> this would also help many of us who are told this can't be done.
>
>
> From: "Damien Alleyne" <g_...@ho...>
> Subject: Re: [Dev-C++] Setting text colour Date: Sat, 12 Apr 2003
> 09:20:05 -0400
> Well Louis,
>
> I was surprised by so many people saying that it couldn't be done
> anymore.
> The last time I did text colouring was last year. Anyway, this sample
> works on my
> system which is a P4 running WinXP. It worked when I was runing WinME.
> Tell me if It works on your system.
>
>
> #include <conio.c>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(void)
> {
> printf("Hmmmm. Lets try to change these colors up.\n");
> textcolor(YELLOW);
> printf("This line should be blue\n");
> textcolor(RED);
> printf("This line should be red.\n");
>
> printf("Anyway. Later Guys\n");
> system("PAUSE");
> return 0;
> }
>
>
>
> --- Damien Alleyne <g_...@ho...> wrote:
>
> ---------------------------------
>
>
>
>
>
>
> Take a look at the conio.h header file in the Dev-C++ include directory.
> There are functions in there for console text formatting. Make sure to
> include the conio.c as an additional command while calling the compiler or
> simple include it instead of conio.h.
>
> Original G
> ----Original Message Follows---- From: "Dany P. Wu" To: Subject: [Dev-C++]
> Setting text colour Date: Sat, 12 Apr 2003 21:06:17 +1200 Hi everyone, I'm
> just writing console programs at the moment, and was wondering if there's
> a way of setting foreground and background colour of text? Is this
> possible using standard C++ libraries? Cheers, Dany. -- This mail is a
> natural product. The slight variations in spelling and grammar enhance its
> individual character and beauty and in no way are to be considered flaws
> or defects. ------------------------------------------------------- This
> SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for
> complex code. Debugging C/C++ programs can leave you feeling lost and
> disoriented. TotalView can help you find your way. Available on major UNIX
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________ Dev-cpp-users mailing list
> Dev...@li... TO UNSUBSCRIBE:
> http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
> ---------------------------------
> The new MSN 8: smart spam protection and 2 months FREE*
> -------------------------------------------------------This SF.net email
> is sponsored by: Etnus, makers of TotalView, The debugger for complex
> code. Debugging C/C++ programs can leave you feeling lost and disoriented.
> TotalView can help you find your way. Available on major UNIX and Linux
> platforms. Try it free.
> www.etnus.com_______________________________________________Dev-cpp-users
> mailing lis...@li... UNSUBSCRIBE:
> http://www.noicys.cjb.net/devcpp/ub.htmhttps://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://tax.yahoo.com
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
> for complex code. Debugging C/C++ programs can leave you feeling lost and
> disoriented. TotalView can help you find your way. Available on major UNIX
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Daniel K. O. <dan...@ya...> - 2003-04-12 23:46:49
|
> We can hardly avoid knowing about the conio package since this list has > questions about it every 2-4 weeks. LOL It's more like 2-4 times per week. :D Daniel K. O. |