www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - looking for console library

reply Sai <Sai_member pathlink.com> writes:
I am looking for a D console library. I found this archive,
but the link mentioned in there doesn't work.

http://www.digitalmars.com/d/archives/16286.html

The link to the console library by Andy Friesen 
http://earth.prohosting.com/carlos3/console.html

If that library is still availible, could someone please
give me a pointer. Any console library will do.

I just want some way to change colors of text in a console
on Windows.

Thanks in advance
Sai
Dec 07 2005
next sibling parent pragma <pragma_member pathlink.com> writes:
In article <dn7945$kj4$1 digitaldaemon.com>, Sai says...
I am looking for a D console library. I found this archive,
but the link mentioned in there doesn't work.

http://www.digitalmars.com/d/archives/16286.html

The link to the console library by Andy Friesen 
http://earth.prohosting.com/carlos3/console.html

If that library is still availible, could someone please
give me a pointer. Any console library will do.

I just want some way to change colors of text in a console
on Windows.

Thanks in advance
Sai
AFAIK there are three ways for you to go about getting colored text output in a console with D: 1) "Go oldskool" and set your console/environment to use ansi.sys, then use ansi escape sequences via printf: http://www.cvcc.edu/department/facstaff/frichard/csc120/projects/jan16.html 2) Use the Windows API to write to the console: http://www.gamedev.net/community/forums/topic.asp?topic_id=293110 3) Forget the console completely and go with the myriad of windowing toolkits available over on dsource: http://www.dsource.org/projects/ - EricAnderton at yahoo
Dec 07 2005
prev sibling next sibling parent J C Calvarese <technocrat7 gmail.com> writes:
In article <dn7945$kj4$1 digitaldaemon.com>, Sai says...
I am looking for a D console library. I found this archive,
but the link mentioned in there doesn't work.

http://www.digitalmars.com/d/archives/16286.html

The link to the console library by Andy Friesen 
http://earth.prohosting.com/carlos3/console.html

If that library is still availible, could someone please
give me a pointer. Any console library will do.
Looks like it's here now: http://aegisknight.org/~andy/d/console-19-sep-2003.zip <description> String formatting/Console stream - deprecated A nearly idiot-proof printf workalike, and a Console stream. Last updated 19 Sep 2003. Integrated into Apropos. </description> I found the new website from this wiki page: http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/DLinks jcc7
Dec 07 2005
prev sibling next sibling parent David L. Davis <SpottedTiger yahoo.com> writes:
In article <dn7945$kj4$1 digitaldaemon.com>, Sai says...
I am looking for a D console library. I found this archive,
but the link mentioned in there doesn't work.

http://www.digitalmars.com/d/archives/16286.html

The link to the console library by Andy Friesen 
http://earth.prohosting.com/carlos3/console.html

If that library is still availible, could someone please
give me a pointer. Any console library will do.

I just want some way to change colors of text in a console
on Windows.

Thanks in advance
Sai
Sai, you could check out the conversion I did of wincon.h to wincon.d, which also has a couple of examples (the Rainbow.d example shows how to change both the foreground and background console text colors) at the link below: http://spottedtiger.tripod.com/D_Language/D_Hub_Adv_Tutor_XP.html David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Dec 07 2005
prev sibling parent reply "Lionello Lunesu" <lio remove.lunesu.com> writes:
Hi,

I've translated disp.h from the crt to D; attached. Here's an example:

import disp;

enum color {
  black,
  blue,
  green,
  cyan,
  red,
  purple,
  yellow,
  gray,
  grey = gray,   // alternate spelling
  dark_gray,    // bright+black
  dark_grey = dark_gray, // alternate spelling
  bright_blue,
  bright_green,
  bright_cyan,
  bright_red,
  bright_purple,
  bright_yellow,
  white,     // bright+gray
  bright = 8
};

void main()
{
 disp_setattr(color.white);
 writef( "white" );
 disp_setattr(color.gray);
 writefln( "gray" );
}

This is cut out of a lager utility I'm making, I haven't compiled it as 
such. Hope this helps..

L. 
Dec 07 2005
parent "Lionello Lunesu" <lio remove.lunesu.com> writes:
Forgot the attachment. Love it when that happens...

L. 


begin 666 disp.zip

MI/R'D6X_!-2#T-YM>T6K4TO9.[24KNAV;U>G4Q42`U'=.++-FU;\][-C)S .
MA&X0(1X_,WX\?CPQG1;T2;JE\7S!P>LWH?O'U?M?SWV_"],MW,7SF <8[ /*

M<<)=IP%1S-+G9/E*R9J=F8:08,,0+BDC5(!LDX#U2H

M$5!HG;7;[6;O&'2.^"N)D%>+"#BG-8ATR4-/-&W$BL21AF"T0GB*2?B2D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