Ncurses and menus part 2

Thanks for the reply Steve,

The trouble is in starting. We have a simple little menu test program
that we wrote. The compiler and linker like it. But, runtime fails.
First, we do a initscr, then a newitem and the failure occurs on the
third command newmenu. This is the not knowing phase of a new function
or in this case a set of functions.

Thanks for the help.

Hi,

Dixie Sams <dixie@imaginei.com> wrote in message
news:3A89AC26.477BA451@imaginei.com

Thanks for the reply Steve,

The trouble is in starting. We have a simple little menu test program
that we wrote. The compiler and linker like it. But, runtime fails.
First, we do a initscr, then a newitem and the failure occurs on the
third command newmenu. This is the not knowing phase of a new function
or in this case a set of functions.

Our code is all “layered” C++ code, but in working my way through it, it
appears that you have it generally right…
However, I noticed some points of interest…

  1. It appears that the initscr() is not even necessary to actually set up
    the menu - but, of course it will be necessary to eventually use it.

  2. The code we have “translates” into something like this in C…

ITEM *itemlist[ MAXLISTSIZE ];
MENU *menuvar;

menuvar = NULL;

for ( i = 0; i < MAXLISTSIZE; i++ )
itemlist[ i ] = NULL;

for ( i = 0; i < actualmenuitems; i++ )
item[ i ] = new_item( ptr, ptr );

menu_var = new_menu( itemlist );

Note that there is a lot of pointer indirection going on here…


What type of failure are you getting at runtime?

Thanks for the help.

Dixie Sams <dixie@imaginei.com> wrote:

Thanks for the reply Steve,

The trouble is in starting. We have a simple little menu test program
that we wrote. The compiler and linker like it. But, runtime fails.
First, we do a initscr, then a newitem and the failure occurs on the
third command newmenu. This is the not knowing phase of a new function
or in this case a set of functions.

Get the ncurses source package from QUICS if you have id on it,
otherwise just get it from public domain.

There are planty of samples including how to use Menu/Panel/Form…

-xtang

We have the source from QUICS. We found no refece rences to menu in the C
source. What have we missed.

Thanks,

Larry

Xiaodan Tang wrote:

Dixie Sams <> dixie@imaginei.com> > wrote:
Thanks for the reply Steve,

The trouble is in starting. We have a simple little menu test program
that we wrote. The compiler and linker like it. But, runtime fails.
First, we do a initscr, then a newitem and the failure occurs on the
third command newmenu. This is the not knowing phase of a new function
or in this case a set of functions.

Get the ncurses source package from QUICS if you have id on it,
otherwise just get it from public domain.

There are planty of samples including how to use Menu/Panel/Form…

-xtang

Larry Sams <imagine@galstar.com> wrote:

We have the source from QUICS. We found no refece rences to menu in the C
source. What have we missed.

If you have the ncurses-4.2-bin.tgz from QUICS, look into
“ncurses/test/ncurses.c”, that is the file to test all the
ncurses functionality, including form/panel/menu …

-xtang

Xiaodan Tang wrote:

Dixie Sams <> dixie@imaginei.com> > wrote:
Thanks for the reply Steve,

The trouble is in starting. We have a simple little menu test program
that we wrote. The compiler and linker like it. But, runtime fails.
First, we do a initscr, then a newitem and the failure occurs on the
third command newmenu. This is the not knowing phase of a new function
or in this case a set of functions.

Get the ncurses source package from QUICS if you have id on it,
otherwise just get it from public domain.

There are planty of samples including how to use Menu/Panel/Form…

-xtang