PDA

View Full Version : Java/C/anything - update single line on screen - like a progress bar


Meson
June 19th, 2008, 10:06 PM
In general, how do you write a cli program that updates the same text field in the shell? Like the progress bars that show download speed...

kknd
June 19th, 2008, 10:15 PM
You can use the library ncurses!

Can+~
June 19th, 2008, 10:17 PM
Or start writing over the same line with '\r' (at least on unix, dunno if this works on windows).

Meson
June 24th, 2008, 04:36 PM
I've had a lot of fun writing a program using ncurses and compiled/ran it successfully on my system. I can't seem to find a download of the library for Windows. Does such a thing exist?

henchman
June 25th, 2008, 02:00 AM
There is a thread regarding this question here (http://ubuntuforums.org/showthread.php?t=620308).

If you only want to have this function just #include <conio.h> and use gotoxy(x,y); :)