console colors and line input ...

T

Tonino Greco

Hi,

I am needing todo a screen in unix console that looks something like :

#!/usr/bin/perl

use Term::ANSIColor;
use POSIX qw(strftime);
sub now { strftime "%Y/%m/%d %T ", localtime; }


print color("clear");
print color("white on_black"), " ";
print color("white on_blue"), " Menu";
print color("white on_black"), " ";
print color("white on_blue"), &now , "\n", color("reset");

print color("white on_blue"), " ", "Menu
Selection"," \n", color("reset");

print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), " ", color("blue on_white"),
"Username: ", color("white on_black"), " ", color("white on_whit
e"), " \n", color("reset");

print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("white on_white"), "
\n", color("reset");
print color("yellow on_blue"), "Please enter your Password ...
\n", color("reset");
print color("yellow on_blue"), "Data directory is :
\n", color("reset");



and I want to be able to keep the cursor at the Username section
forinput from the user ... but still draw the complete page.

Can anyone shed a light on how I can do this ...


IN essence I want to be able to (in a unix console) present a colored
login screen then accept the username - present a password screen - the
same as the username one - and then do some validation and present a
menu to the user ...

Thanks
Tonino
 
A

A. Sinan Unur

thanks for this - is there a tutorial you know of I can look at ?

Please quote an appropriate amount of context.

I don't know much about this but you might want to look into Curses.

http://search.cpan.org/~marcus/Curses-UI-0.95/

http://search.cpan.org/~giraffed/Curses-1.12/

Did you look at the documentation?

Did you try to search for the words 'Curses' and 'Perl' using Google
(that is where you are posting from after all).

As I said, I do not know much about Curses.

On the other hand, if you attempt something, and it does not do what you
want, I am sure someone here would be able to help you.

By the way, please do read the posting guidelines for this group. They
contain valuable information on how you can help others help you.

Sinan
 
A

A. Sinan Unur

and where are these guidlines ?

1. They are posted here regularly.

2. You are posting from Google, have you tried entering

comp.lang.perl.misc posting guidelines

in that search box.

3. And, for people like you, there is a link to the HTML version in the
signature portion in all my replies to you.

*Sigh*

Sinan.
 
T

Tonino

*sigh* indeed - I was going to post a nasty reply but read the
guidelines :

"
Count to ten before composing a followup when you are upset
This is recommended in all Usenet newsgroups. Here in clpmisc, most
flaming sub-threads are not about any feature of Perl at all! They are
most often for what was seen as a breach of netiquette. If you have
lurked for a bit, then you will know what is expected and won't make
such posts in the first place.

But if you get upset, wait a while before writing your followup. I
recommend waiting at least 30 minutes.

"

so I guess you are off the hook ... I'd rather opt for the "if you have
nothing NICE or constructive to say"
- then rather say nothing ...

Maybe you could take a note from the above saying ....
 
T

Tassilo v. Parseval

Also sprach Tonino:
*sigh* indeed - I was going to post a nasty reply but read the
guidelines :

"
Count to ten before composing a followup when you are upset
This is recommended in all Usenet newsgroups. Here in clpmisc, most
flaming sub-threads are not about any feature of Perl at all! They are
most often for what was seen as a breach of netiquette. If you have
lurked for a bit, then you will know what is expected and won't make
such posts in the first place.

But if you get upset, wait a while before writing your followup. I
recommend waiting at least 30 minutes.

"

so I guess you are off the hook ... I'd rather opt for the "if you have
nothing NICE or constructive to say"
- then rather say nothing ...

What Sinan said apparently helped you to locate the posting guidelines.

Other than that you've probably already lost. Thinskinned as you seem to
be, you're not going to survive for a very long time in here.

And meanwhile, you're still not providing context through quotes even
though the guidelines describe an effective followup style in great
detail. I am not surprised you missed that part but found the one you
quoted above (which was not applicable in this situation).

Tassilo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top