tags:

views:

280

answers:

1

I'm interested in writing a text-mode "gui" application with ruby. This means I need to have a way to output text anywhere I want in the terminal, move cursor around and react directly to different keypresses. Using color would also be a nice plus.

Is ncurses the only (or clearly best) way to go, or are there other options to consider? I'm not saying there's anything wrong with ncurses, but I like to be aware of my options. (For information about using ncurses with Ruby, there's already another question.)

+1  A: 

In C there were two historic choices for terminal blob graphics and text addressing: use ncurses or use the lower-level termcap/terminfo library. I imagine that for Ruby only ncurses bindings exist.

So I'm guessing that there are these choices:

  • Use ncurses as you mentioned
  • Use the lower-level termcap/terminfo lib. This doesn't really make any sense, plus you would probably have to make the ruby bindings yourself.
  • There are a number of widget libraries that wrap ncurses. See Newt, and Dialog, and CDK. You would probably have to create the Ruby bindings.
DigitalRoss
Well, since nobody came forward with any other options, I take it to mean this has it covered. Accepted, and thanks!
Ilari Kajaste