Hello everyone,
I'm having trouble controlling the cursor position when I make two
consecutive calls to the get family of functions. This problem does not
happen if there is an output in between.
The following code illustrates the problem in a simplified way:
#include "curses.h"
int main() {
initscr();
echo();
mvaddstr(5, 5, "Option: ");
getch(); // works ok. First call.
mvaddstr(4, 5, "Option: ");
getch(); // works ok. Second call after an output.
// note how this following call gets affected by the previous
getch().
// The cursor is not placed at 3,5, as requested
// It is instead waiting for input one char to the right of the
previous getch().
// (or the next line if your input was blank)
mvgetch(3, 5);
endwin();
}
How can I handle input calls in succession and still keep control of
the cursor position with curses?
Thank you in advance,
Mario Figueiredo