mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 23:16:22 +00:00
Moved windows on resize
This commit is contained in:
21
input_win.c
21
input_win.c
@@ -60,6 +60,15 @@ void create_input_window(void)
|
||||
wrefresh(inp_win);
|
||||
}
|
||||
|
||||
void inp_win_resize(const char * const input, const int size)
|
||||
{
|
||||
int rows, cols;
|
||||
getmaxyx(stdscr, rows, cols);
|
||||
mvwin(inp_win, rows-1, 0);
|
||||
wresize(inp_win, 1, cols);
|
||||
wrefresh(inp_win);
|
||||
}
|
||||
|
||||
void inp_clear(void)
|
||||
{
|
||||
wclear(inp_win);
|
||||
@@ -83,7 +92,8 @@ void inp_get_char(int *ch, char *input, int *size)
|
||||
int inp_x = 0;
|
||||
int i;
|
||||
|
||||
// echo off, and get some more input
|
||||
|
||||
// echo off, and get some more input
|
||||
noecho();
|
||||
*ch = wgetch(inp_win);
|
||||
|
||||
@@ -131,15 +141,6 @@ void inp_put_back(void)
|
||||
wrefresh(inp_win);
|
||||
}
|
||||
|
||||
void inp_win_write(const char * const new_input, const int size)
|
||||
{
|
||||
int i;
|
||||
inp_clear();
|
||||
for (i = 0; i < size; i++)
|
||||
waddch(inp_win, new_input[i]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Deal with command editing, return 1 if ch was an edit
|
||||
* key press: up, down, left, right or backspace
|
||||
|
||||
Reference in New Issue
Block a user