I'm trying to make a htop like in ncurses.
htop
ncurses
I'm doing an infinite loop to have the information updating and a condition to make it stop. But it doesn't update itself because it wants to check the input before.
What shall I do ?
When you are initializing the curses parameters, you could use the next function
timeout(TIME_IN_MILLIS);
code sample:
initscr(); cbreak(); noecho(); nonl(); timeout(1000); mvprintw( 1, 1, "%s", "Hello World!" ); refresh(); getch(); endwin();
htop author here -- htop itself is written in ncurses. You need to use the halfdelay() function to make the input function timeout.
See http://linux.die.net/man/3/halfdelay
Copyright © 2021 Jogjafile Inc.
When you are initializing the curses parameters, you could use the next function
code sample: