curses! trouble with pads and panels

Edmond Ho edho at
Tue Sep 2 08:19:13 CEST 2003

Hi, I'm having trouble with a small curses program. I'm associate a pad with
a panel. As I understand, a pad is supposed to be just a window with an
arbitrary size. That seems to imply that a pad can be treated like a normal
window when working with panels. I have this code:

#!/usr/bin/env python

import curses
import curses.panel


pad = curses.newpad(100, 100)
win = curses.newwin(1, 80, 0, 0)

padp = curses.panel.new_panel(pad)
winp = curses.panel.new_panel(win)



If you comment out the line 13 (where padp is declared), the program is
fine, albeit useless. But with the line 13, I get this error:

Traceback (most recent call last):
File "", line 13, in ?
padp = curses.panel.new_panel(pad)
_curses_panel.error: curses function returned NULL

So, what am I doing wrong?

cheers, ed

More information about the Python-list mailing list