I create 3 windows on top of the standard screen, with screen-width columns and one row height with:
WINDOW* pWindow = newwin(0, COLS - 1, windowNr, 0); // windowNr 0 - 2
Which renders normally as consequitive windows:
----------------------------0 Window----------------------------
----------------------------1 Window----------------------------
----------------------------2 Window----------------------------
My problem is under the last created window I want a pad which I create with:
WINDOW* pPad = newpad(LINES - 3, COLS - 1); // 3 because of the three pWindows
But pad
is rendered above all pWindows
:
----------------------------0 Pad----------------------------
----------------------------0 Pad----------------------------
----------------------------0 Pad----------------------------
How can I position the pad below the last window that the output is:
----------------------------0 Window----------------------------
----------------------------1 Window----------------------------
----------------------------2 Window----------------------------
------------------------------0 Pad-----------------------------
------------------------------0 Pad-----------------------------
------------------------------0 Pad-----------------------------
The newpad
has unfortunately no (y,x) cooridnates as newwin
has. To simply fill the pad with debug content I do:
werase(pPad); // Clear window, https://invisible-island.net/ncurses/man/curs_clear.3x.html
wmove(pPad, 0, 0); // Moves cursor in pad to y,x
for(int c = 0; c < 40; c++){
string s = to_string(c) + ".\n";
wprintw(pPad, s.c_str());
}
prefresh(pPad, 0, 0, 0, 0, maxRows, maxCols);
I also put different values in prefresh
, its viewport scrolling or rather refreshing works perfectly as described in the documentation.