Subject: Re: Curses and function-keys
To: None <netbsd-users@netbsd.org>
From: Zbigniew Baniewski <zb@ispid.com.pl>
List: netbsd-users
Date: 01/15/2006 17:31:01
On Sun, Jan 15, 2006 at 03:52:57PM +0000, Julian Coleman wrote:

> When I run the program in an xterm, I do see colours,

But try to link it with your curses first - and then with ncurses. My former
post was telling about executable using ncurses.

Yes, when using your curses, it seems to work a bit better in NetBSD's
environment. Are ncurses not quite compatible with NetBSD?

> but the keys aren't
> recognised.  This is because, for our curses, it needs to call cbreak() - I
> added this call just after the noecho() line in init_curses().  Possibly, we
> should default to cbreak mode when initscr() is called.

I have added raw() immediately after initscr() - but I wasn't sure, is it
the proper way.

>   it deletes the items[0] window and then tries to delete the sub-windows of
>   that window.  This causes our curses code to go into a loop.  I'll look at
>   fixing this.

Right. Found it too. Shouldn't it just dispose of all the subwindows,
when "parent" is already deleted? (even without a need to delete
sub-windows separately...)

> It looks like there is another bug in our curses library - when a key is
> pressed, the first 80 columns on the bottom row of the screen turn black.
> It's probably related to our handling of background attributes versus default
> colours, which isn't well tested.  I'll look at that too.

Found another thing: it seems, that subwindows (in NetBSD's curses) cannot
"inherite" properties (like back-/foreground colour, for example) of the
"parent" windows. Look at that "draw_menu" procedure - before
wbkgd(items[1],COLOR_PAIR(4)); (which shows the position of "higlight tab"),
I had to add:

 for (i=1;i<9;i++) {
   wbkgd(items[i],COLOR_PAIR(2));
 }

...just to set color pair for each subwin separately - although a few lines
earlier there was:

  items[0]=newwin(10,19,1,start_col);
  wbkgd(items[0],COLOR_PAIR(2));

So, the "parent" window has been set - but "children" forgot the settings.
Is it a bug - or feature?
-- 
				pozdrawiam / regards

						Zbigniew Baniewski