Search code examples
cncursescurses

Set cursor movement field in ncurses


I am using ncurses and I want to know , is there anyway to control cursor movement , as in setting the leftmost , rightmost cell it can reach in a particular window .

For bottomost I am using scrollok() so that the text doesnt overflow , is there anyway for left and right ?


Solution

  • X/Open Curses (e.g., ncurses) provides two groups of functions for adding text to the screen:

    • those that wrap at the right margin
    • those that do not wrap at the right margin

    addstr, addwstr and similar functions ultimately call addch or add_wch, respectively, which wrap.

    addchstr, add_wchstr and similar functions do not wrap. You probably want these.