add update system

This commit is contained in:
smayzy 2025-12-16 10:01:03 +01:00
parent c6614d9239
commit 1a336d46e3

View File

@ -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);