Hi,
I'm writing some widgets in curses.
Actually I'm trying to write a combobox. To do so, I need to create a pad
inside a panel, so that I can hide/show it.
I can't do it.
I can create a normal pad, but if I try to create it using "subpad" from a
window I get
_curses_panel.e rror: curses function returned NULL
, if the pad is greater than the window. But aren't pad supposed to be
greater than windows ?
If I create a pad and I try to attach it to a panel, with
panel.new_panel (pad)
I get again
_curses_panel.e rror: curses function returned NULL
I need to have a pad to show/hide.
Am I doing something wrong ?
Here comes what I do
########
import curses
from curses import panel
def main(stdscr):
pad = curses.newpad(1 00, 100)
pad.bkgd('x',0)
pad.refresh( 0,0, 5,5, 15,15)
pad.getch()
def main_1(stdscr):
win=curses.neww in(0,0)
pad=win.subpad( 100,100) #<--- error
my_pan=panel.ne w_panel(win)
pad.bkgd('x',0)
pad.refresh( 0,0, 5,5, 15,15)
panel.update_pa nels()
curses.doupdate ()
pad.getch()
def main_2(stscr):
pad = curses.newpad(1 00, 100)
a_panel= panel.new_panel (pad) #<--- error
pad.bkgd('x',0)
pad.refresh( 0,0, 5,5, 15,15)
panel.update_pa nels()
curses.doupdate ()
pad.getch()
if __name__=='__ma in__':
curses.wrapper( main)
#curses.wrapper (main_1)
#curses.wrapper (main_2)
########
Thank you,
Riccardo
--
-=Riccardo Galli=-
_,e.
s~ ``
~@. ideralis Programs
.. ol
`**~ http://www.sideralis.net