472,102 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,102 software developers and data experts.

curses library - controlling cursor position with consecutive input requests

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

Nov 15 '06 #1
1 4562
On 15 Nov 2006 14:18:23 -0800, "Mario Figueiredo" <ma****@gmail.com>
wrote in comp.lang.c++:
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.
[snip]

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
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by harold fellermann | last post: by
30 posts views Thread by Ian Ward | last post: by
3 posts views Thread by stormandstress | last post: by
2 posts views Thread by krishnakant Mane | last post: by
2 posts views Thread by Kenneth McDonald | last post: by
8 posts views Thread by linkmaster032000 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.