Playing with $stdout...

D

Drew Shapiro

Hi,

I'm trying to create a library of functions for programs that use a
command line interface. One feature I'd like to implement is a
date_selector. What I'd like to have is the $stdout display todays date
with one field somehow highlighted. The user could then navigate and
adjust using the arrow keys untill the desired date is set and press
Enter. My problem is that I'm not sure how to rewrite something that's
already been printed to the standard output, if that's possible at all.

Does any of this make sense or am I crazy?
 
B

Brett Simmers

You can probably accomplish that with the standard curses library:
http://ruby-doc.org/stdlib/libdoc/curses/rdoc/index.html

Or the ncurses-ruby library:
http://ncurses-ruby.berlios.de/

The "documentation" for the former is pretty much just a list of
functions. The second one seems to be a fairly direct mapping to the
ncurses C library, so you can use documentation for the C library. As
far as I know, ncurses is one of the most popular libraries for doing
manipulation of the console.

-Brett
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top