ncurses pad question

M

Mag Gam

I am having some trouble understanding how padding/windowing works for
Python curses. According to this example on
http://docs.python.org/howto/curses.html 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:

pad1=curses.newpad(100,300)

pad1.addch(0,0,ord('X'))

pad1.refresh(0,0,120,120,110,130)


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

Any ideas?
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top