Reputation: 503
Im looking to make program with a similar feature as the Download Progress Text with the arrow going across.. Example PIC is a reference to what im talking about.
Any libraries or designs with basic functions? Thanks for any help!
Upvotes: 0
Views: 259
Reputation: 70472
If all you want is a progress bar for some data, you should check out pv
. One way to use it is to simply pipe your data through the program. Here is a simple example below that just reads in a file using a call to pv
with popen()
:
#include <stdio.h>
int main (int argc, char *argv[]) {
char pv[1024];
FILE *infile;
if (argc > 1) {
char c;
snprintf(pv, sizeof(pv), "pv %s", argv[1]);
infile = popen(pv, "r");
while (fread(&c, 1, 1, infile)) {}
pclose(infile);
} else {
puts("need a file name!");
}
return 0;
}
Upvotes: 0
Reputation: 3761
The library you are looking for is ncurses
. It can be found here.
Here is another resource I found for ncurses
that may be useful to help introduce you to the library and its functionality. It's a series of Youtube tutorials -- his speaking is poor but from what I can tell (listening only to the first two videos) his examples are sufficiently well taught.
Upvotes: 1