curses! trouble with pads and panels

Discussion in 'Python' started by Edmond Ho, Sep 2, 2003.

  1. Edmond Ho

    Edmond Ho Guest

    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
     
    Edmond Ho, Sep 2, 2003
    #1
    1. Advertising

  2. Edmond Ho <> 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 <> <>
    http://dickey.his.com
    ftp://dickey.his.com
     
    Thomas Dickey, Sep 2, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Ruegsegger

    SmartNavigation and Panels causing debug error

    Chris Ruegsegger, Aug 6, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    462
    Yan-Hong Huang[MSFT]
    Aug 8, 2003
  2. Richard Fennell

    asp:listbox, panels and z-order

    Richard Fennell, Aug 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,243
    Richard Fennell
    Aug 27, 2003
  3. V Arzola
    Replies:
    0
    Views:
    521
    V Arzola
    Mar 21, 2006
  4. Jean-Paul Calderone
    Replies:
    2
    Views:
    438
    Joel Hedlund
    Feb 9, 2006
  5. V Arzola

    Trouble rendering form panels in firefox and netscape

    V Arzola, Mar 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    109
    V Arzola
    Mar 21, 2006
Loading...

Share This Page