Home:ALL Converter>ncurses 10,10 pad causes error when addstr to 9, 9

ncurses 10,10 pad causes error when addstr to 9, 9

Ask Time:2013-05-27T05:01:41         Author:Dan

Json Formatter

After declaring a 10 by 10 pad, I apparently can't write to lower right corner, 9, 9 without an error. What is going on here?

import curses

def start(stdscr):
    curses.curs_set(0)
    movement = curses.newpad(10, 10)

    movement.addstr(8, 9, '+')
    movement.addstr(9, 8, '+') 
    movement.addstr(9, 9, '+') #This line causes an error

if __name__ == '__main__':
    curses.wrapper(start)

causes:

  File "curses_movement_testing.py", line 35, in <module>
    curses.wrapper(start)
  File "/usr/lib64/python2.6/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "curses_movement_testing.py", line 10, in start
    movement.addstr(9, 9, '+')
_curses.error: addstr() returned ERR

why can't I write to the the lower right corner cell?

Author:Dan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/16763653/ncurses-10-10-pad-causes-error-when-addstr-to-9-9
yy