By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,183 Members | 1,190 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,183 IT Pros & Developers. It's quick & easy.

curses! trouble with pads and panels

P: n/a
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

curses.initscr()
curses.cbreak()
curses.noecho()

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

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

curses.panel.update_panels()
curses.doupdate()

pad.getch()
curses.endwin()

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 "pad.py", line 13, in ?
padp = curses.panel.new_panel(pad)
_curses_panel.error: curses function returned NULL

So, what am I doing wrong?

cheers, ed
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Edmond Ho <ed**@nospam.stanford.edu> wrote:
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


not exactly - some special handling is needed in the library to make it
treat pads like a normal window. Your example may be a case where it's
not implemented.
--
Thomas E. Dickey <di****@radix.net> <di****@his.com>
http://dickey.his.com
ftp://dickey.his.com
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.