curses library - controlling cursor position with consecutive input requests

Discussion in 'C++' started by Mario Figueiredo, Nov 15, 2006.

  1. 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() {


    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
    // 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);



    How can I handle input calls in succession and still keep control of
    the cursor position with curses?

    Thank you in advance,
    Mario Figueiredo
    Mario Figueiredo, Nov 15, 2006
    1. Advertisements

  2. Mario Figueiredo

    Jack Klein Guest


    You'll need to ask this question in a group that supports your
    particular compiler, operating system, and curses library
    implementation. Curses is a non-standard extension, not part of the
    C++ language.
    Jack Klein, Nov 16, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.