ncurses pad question

Mag Gam magawake at
Wed Sep 22 00:04:24 CEST 2010

I am having some trouble understanding how padding/windowing works for
Python curses. According to this example on I see:

pad = curses.newpad(100, 100)
#  These loops fill the pad with letters; this is
# explained in the next section
for y in range(0, 100):
    for x in range(0, 100):
        try: pad.addch(y,x, ord('a') + (x*x+y*y) % 26 )
        except curses.error: pass

#  Displays a section of the pad in the middle of the screen
pad.refresh( 0,0, 5,5, 20,75)

Now if I want another pad, lets call it:




For some reason I get,
pad1.refresh(0,0,120,130,140,180) _curses.error:prefresh() return ERR

Any ideas?

More information about the Python-list mailing list