473,513 Members | 3,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

curses : unexpected behaviour with pad

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.error: 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.error: 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(100, 100)
pad.bkgd('x',0)
pad.refresh( 0,0, 5,5, 15,15)
pad.getch()

def main_1(stdscr):
win=curses.newwin(0,0)
pad=win.subpad(100,100) #<--- error
my_pan=panel.new_panel(win)
pad.bkgd('x',0)
pad.refresh( 0,0, 5,5, 15,15)
panel.update_panels()
curses.doupdate()
pad.getch()

def main_2(stscr):
pad = curses.newpad(100, 100)
a_panel= panel.new_panel(pad) #<--- error
pad.bkgd('x',0)
pad.refresh( 0,0, 5,5, 15,15)

panel.update_panels()
curses.doupdate()
pad.getch()

if __name__=='__main__':
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
Jul 18 '05 #1
1 3278
> def main_1(stdscr):
win=curses.newwin(0,0)
pad=win.subpad(100,100) #<--- error
I found that the behaviour of curses silently considers
subpad of a WINDOW object as also a WINDOW instead of PAD,
whether you uses subpad or subwin. try:

win=curses.newpad(0,0)
pad=win.subpad(100,100)
def main_2(stscr):
pad = curses.newpad(100, 100)
a_panel= panel.new_panel(pad) #<--- error


Panel does not support PAD. you must use WINDOW. this should
works:

pad = curses.newwin(100, 100)
a_panel= panel.new_panel(pad)

--
Best regards,
dody mailto:do**@postaccesslite.com












Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1828
by: AK | last post by:
Hi, I have a medium sized app that I'm transferring to use curses. What happens is very very strange.. I am at my wits' ends. I worked with it all day yesterday and couldn't figure it out....
0
392
by: AK | last post by:
Hi, I have a medium sized app that I'm transferring to use curses. What happens is very very strange.. I am at my wits' ends. I worked with it all day yesterday and couldn't figure it out....
2
2158
by: Gerhard Esterhuizen | last post by:
Hi, I am observing unexpected behaviour, in the form of a corrupted class member access, from a simple C++ program that accesses an attribute declared in a virtual base class via a chain of...
1
9127
by: Nick ! | last post by:
Chris Share <usenet at caesium.me.ukwrote: http://web.cs.mun.ca/~rod/ncurses/ncurses.html#xterm says "The ncurses library does not catch signal, because it cannot in general know how you want...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.