Which Text-Based UI Do You Code With? 211
JHWH asks: "I've been asked to design and implement a management software system with text based user interface as the replacement of an older one running on AS/400. Despite my attempts towards a web UI, the customer is actually willing to have a text based UI. The main reasons are the need for a very low bandwidth and the ability to run on serial terminals. All this in the 21st century! Host systems will be Linux, the language will be C or C++. I already thought about the use of text based browsers like lynx or links. So now I have to wipe the dust away from my ncurses manual, or can Slashdot suggest something more effective?"
SLANG (Score:4, Interesting)
once recommended me to try using the slang API
instead of (n)curses based on the fact that he bought a ncurses book
and it sucked monkeyballs and programming ncurses is not really intuitive
some of the other fine folk who regularly sit idle in that channel
also said that if it could be done in a Shell script
you could try using shell and dialog which is a ncurses based program btw
this could obviously be a biased opinion from slackers since the pkgtools in slackware http://www.slackware.com/ [slackware.com] are written this way
and they have served us fine for many years
and will continue to serve us happily for many more years to come.
anyway good luck
Turbo Vision! (Score:3, Interesting)
Screenshot from the link of it on QNX: http://tvision.sourceforge.net/tv2-QNX-tvscreen.j
The nice thing about it is that it's OO... one of the very first OO TUI's, if I remember correctly.
I have absolutely no idea how it'll work over a terminal. XTerms an option?
Re:Text based UI is underrated! (Score:3, Interesting)
Re:pokey reference (Score:3, Interesting)
why bother with conio (console i/o - a borland c / turbo c library) when you can just write the raw ansi sequences to the screen? They're really easy, and you can even prototype your interface with nothing more than a text editor (vi or notepad) and "playing" it to your terminal ("type 'filename'" in dos, "cat 'filename'" in linux).
http://www.dee.ufcg.edu.br/~rrbrandt/tools/ansi.ht ml [ufcg.edu.br] ansi escape sequences.
You can clear the screen, home the cursor, more the cursor to specific coordinates, erase to the end of a line, change foreground and background colors, even have web 1.0-style blinking text.
Just remember that you have to send sequences to set your terminal into raw mode if you don't want line-buffered keyboard input.
Re:What's wrong with ncurses? (Score:5, Interesting)
And you will then discover some of the reasons why you should have used ncurses in the first place:
1. Does the cursor jump to the next line when you hit the 80th column?
2. If you type a character in the lower right corner, does it scroll up the screen?
3. Are they going to bring in some non-ansi terminals and expect you to make them all work?
4. Which subset of the ansi sequences are going to be available? Using xterm, gnome-terminal, putty, ansi.sys,
5. What other intresting "bugs" in all the possible terminals do you need to work around?
I'd rather use a library that already handles all the crap.
Re:Emacs! (Score:3, Interesting)
--
Evan
Re:What's wrong with ncurses? (Score:3, Interesting)
Only if your terminal window is 80 columns wide. Of course, if you want it to no matter what the actual width, just insert a newline at col80 ...
Only if you haven't first set the terminal to raw input ...
Just try to find a terminal that doesn't support the standard ansi escape codes ... they may add extra functionality built upon it, but you can safely ignore that by sticking to the base escape codes.
So just use the bog-standard ansi sequences.
As I said, by sticking with the standard escape sequences, you don't have to worry about all the "extensions" each different terminal supports. No need to bother with the terminfo database, etc.