Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > console colors and line input ...

Reply
Thread Tools

console colors and line input ...

 
 
Tonino Greco
Guest
Posts: n/a
 
      04-04-2005
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

 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      04-04-2005
"Tonino Greco" <(E-Mail Removed)> wrote in
news:(E-Mail Removed) oups.com:

> 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 ...


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/

Sinan

--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
 
Reply With Quote
 
 
 
 
Tonino
Guest
Posts: n/a
 
      04-04-2005
thanks for this - is there a tutorial you know of I can look at ?

Tonino

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      04-04-2005
"Tonino" <(E-Mail Removed)> wrote in news:1112619817.839283.221350
@l41g2000cwc.googlegroups.com:

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


Please quote an appropriate amount of context.

"A. Sinan Unur" <(E-Mail Removed)> wrote in
news:Xns962E57AE9A049asu1cornelledu@127.0.0.1:

> 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. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      04-04-2005
Tonino <(E-Mail Removed)> wrote:

> thanks for this



What this is that?

Please quote some context in followups.


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Tonino
Guest
Posts: n/a
 
      04-04-2005
and where are these guidlines ?

Tonino

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      04-04-2005
"Tonino" <(E-Mail Removed)> wrote in news:1112620920.196688.62810
@l41g2000cwc.googlegroups.com:

> 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.

--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
 
Reply With Quote
 
Tonino
Guest
Posts: n/a
 
      04-04-2005

*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 ....

 
Reply With Quote
 
Tassilo v. Parseval
Guest
Posts: n/a
 
      04-04-2005
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
--
use bigint;
$n=71423350343770280161397026330337371139054411854 220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($ m+=<=200);
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any library that can convert RGB colors to ANSI colors? ZelluX Python 3 12-01-2008 11:08 AM
TreeNode colors come from anchor colors AAaron123 ASP .Net 1 08-07-2008 07:56 PM
Reading console output and writing to console jan.rebada@gmail.com C++ 5 03-04-2008 09:00 AM
Crossbrowser Colors for Input-Fields Matthias S. ASP .Net 1 03-10-2005 02:21 PM
Changing disabled colors in an input text form multimatum2 Javascript 4 10-06-2004 05:49 PM



Advertisments