Forum: Ruby Playing with $stdout...

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Drew S. (Guest)
on 2007-06-29 05:02

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?
Brett S. (Guest)
on 2007-06-29 05:26
(Received via mailing list)
You can probably accomplish that with the standard curses library:

Or the ncurses-ruby library:

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.

This topic is locked and can not be replied to.