hide <ncursesw/ncurses.h> behind ncrswrap.*
isolate ct_dims implementation to dims.*
This commit is contained in:
parent
1dd5dd79c8
commit
b04f0b4aa3
8 changed files with 142 additions and 113 deletions
|
|
@ -13,8 +13,6 @@ int ct_init(struct ct_tree **const tree) {
|
|||
|
||||
|
||||
void ct_update(struct ct_tree *const tree) {
|
||||
struct ct_dims * term_dims;
|
||||
int term_width, term_height;
|
||||
const int key = wgetch(curscr);
|
||||
|
||||
/* ncurses binds a SIGWINCH handler if SIGWINCH has SIG_DFL disposition
|
||||
|
|
@ -28,9 +26,7 @@ void ct_update(struct ct_tree *const tree) {
|
|||
wrefresh(tree->root->child[0]->win);
|
||||
return;
|
||||
case KEY_RESIZE:
|
||||
termsize(term_width, term_height);
|
||||
term_dims = __alloc_dims(0, 0, term_width, term_height);
|
||||
resize_tree(tree, term_dims);
|
||||
resize_tree(tree, termdims());
|
||||
// flush ncurses virtual screen -> physical screen
|
||||
doupdate();
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue