add resizemv_window() method to curse.* interface
This commit is contained in:
parent
206f1e6a09
commit
669f620a6a
2 changed files with 13 additions and 0 deletions
10
cli/curse.c
10
cli/curse.c
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue