Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Using Win32::Console::ANSI to set foreground/background attributes for the entire screen

by smack (Beadle)
on Jun 23, 2005 at 12:19 UTC ( #469369=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://469369]
Approved by ChrisR
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2022-10-01 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (126 votes). Check out past polls.

    Notices?