add resizemv_window() method to curse.* interface

This commit is contained in:
Emile Clark-Boman 2025-09-11 17:40:25 +10:00
parent 206f1e6a09
commit 669f620a6a
2 changed files with 13 additions and 0 deletions

View file

@ -70,6 +70,16 @@ WINDOW *root_window(void) {
return rootwin;
}
/* Resize and move (if resized successfully) an ncurses WINDOW.
* Returns ERR (1) on fail, and OK (0) on success.
* NOTE: Failure occurs if width or height <= 0,
* NOTE: or if the x,y coordinate is outside the screen bounds.
*/
int resizemv_window(const int x, const int y, const int width, const int height,
WINDOW *const win) {
return wresize(win, height, width) || mvwin(win, y, x);
}
/*
int main(const int argc, const char *const argv[]) {
init_ncurses();

View file

@ -22,4 +22,7 @@ WINDOW *init_window(const int x, const int y, const int width,
const int height);
WINDOW *root_window(void);
int resizemv_window(const int x, const int y, const int width, const int height,
WINDOW *const win);
#endif /* DORNE_CURSE_H */