http://qs1969.pair.com?node_id=469369

smack has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks;

I have been working a bit with Win32::Console::ANSI. It seems to be a nice module, however, I can't figure out how to get it to change the foreground/text color for the entire screen. I have managed to print text in different colors with lines like this:
print colored ("White on Blue.\n", 'White on_blue');
I want to be able to set themes for entire scripts though, without calling system("color"). Any help would be greatly appreciated!

Cheers,
smack

“There are no cats in America, and the streets are paved with cheese.” -Fievel Mousekewitz
  • Comment on Using Win32::Console::ANSI to set foreground/background attributes for the entire screen
  • Download Code

Replies are listed 'Best First'.
Re: Using Win32::Console::ANSI to set foreground/background attributes for the entire screen
by gawatkins (Monsignor) on Jun 23, 2005 at 17:33 UTC
    smack,

    I have pulled up the code for the module but I do not see a method for doing this. The module only has two exposed functions, Cursor() and Title(). Title() only sets the command window title and Cursor() sets the current position color.

    Is there a reason you did not want to use system("color")? That does seem to be the only wat to do it. Where is TIM TOWTDI when you need him?

    Thank you,
    Greg W.