Compare commits
No commits in common. "1a336d46e3ca7e06860ba65169416992c57aeca5" and "2ac9b83a5513fd62e19695999904e728d3e04753" have entirely different histories.
1a336d46e3
...
2ac9b83a55
39
src/main.c
39
src/main.c
@ -1,48 +1,13 @@
|
|||||||
#include <ncurses.h>
|
#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()
|
int main()
|
||||||
{
|
{
|
||||||
initscr();
|
initscr();
|
||||||
noecho();
|
noecho();
|
||||||
cbreak();
|
|
||||||
curs_set(0);
|
curs_set(0);
|
||||||
|
printw("Hello World");
|
||||||
int y,x;
|
|
||||||
getmaxyx(stdscr, y, x);
|
|
||||||
|
|
||||||
WINDOW *top_win;
|
|
||||||
WINDOW *bottom_win;
|
|
||||||
|
|
||||||
top_win = newwin(y/2, x, 0, 0);
|
|
||||||
bottom_win = newwin(y-y/2, x, y/2, 0);
|
|
||||||
|
|
||||||
box(top_win, 0, 0);
|
|
||||||
box(bottom_win, 0, 0);
|
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
wrefresh(top_win);
|
getch();
|
||||||
wrefresh(bottom_win);
|
|
||||||
|
|
||||||
int ch = ERR;
|
|
||||||
while(ch == ERR)
|
|
||||||
{
|
|
||||||
update(top_win);
|
|
||||||
update(bottom_win);
|
|
||||||
ch = getch();
|
|
||||||
};
|
|
||||||
|
|
||||||
delwin(top_win);
|
|
||||||
delwin(bottom_win);
|
|
||||||
endwin();
|
endwin();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user