In 2.1 (at least), curses.newwin can return a pad
object if it's called with two arguments, i.e.
win = curses.newwin(0,0)
Since this is actually a pad, win.refresh has to be
called with six arguments -- the syntax used for
refreshing a pad -- instead of as just win.refresh()
Looking at the code for _cursesmodule.c, it appears
that only win.refresh() and win.noutrefresh() take
different arguments depending on whether win is
actually a window or a pad.
It looks like there are three options here:
- document that the two-argument version of
curses.newwin returns a pad (and hence the six-argument
.refresh() must be used)
- make curses.newwin take four arguments only (as the
two argument version is currently equivalent to newpad)
- have win.refresh() and win.noutrefresh() do sensible
things for pads (although I don't know what that would
be...)
I would think #2 is the best.
Hmm, perhaps there should be a separate object type for
pads, so we can tell the difference between pads and
windows.
|