add update system
This commit is contained in:
parent
c6614d9239
commit
1a336d46e3
18
src/main.c
18
src/main.c
@ -1,4 +1,14 @@
|
||||
#include <ncurses.h>
|
||||
#include <string.h>
|
||||
|
||||
void update(WINDOW *win)
|
||||
{
|
||||
int win_y, win_x;
|
||||
char message[] = "test";
|
||||
getmaxyx(win, win_y, win_x);
|
||||
mvwprintw(win, win_y/2, win_x/2 - strlen(message)/2, "%s", message);
|
||||
wrefresh(win);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -23,7 +33,13 @@ int main()
|
||||
wrefresh(top_win);
|
||||
wrefresh(bottom_win);
|
||||
|
||||
getch();
|
||||
int ch = ERR;
|
||||
while(ch == ERR)
|
||||
{
|
||||
update(top_win);
|
||||
update(bottom_win);
|
||||
ch = getch();
|
||||
};
|
||||
|
||||
delwin(top_win);
|
||||
delwin(bottom_win);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user