grafit wrote:

>         1> I have used the  "dialog" utility in linux , it worked fine.
>            But I am not able to get the return value and use it in my program.
>            The Manual says it prints the value on stderr.
>            But I am not able to capture it.
>            The program is as follows...........
> 
> #include<stdio.h>
> main()
> {
> char ch;
> 
>       /***************** Menu *******************/
>               
> system("dialog --title \"Box\" --menu \"Select Options\" 20 40 5 \"1\" \"Ftp\" \"2\" 
>\"Exit\"");
> 
>       /********* Read Choice From stderr **************/ 
>       read(2,&ch,1);
>               
>       /************** Print Choice *********/
>         printf("\nCh = %d\n",ch);
> 
> }
> 
>         I want the return value that I have selected

You can't read from the stderr stream which the `dialog' command uses;
it is your process' stderr stream. You could add e.g. ` 2>dialog.out'
to the end of the string which is passed to system. This would write
the result to the file `dialog.out', which you could then read.

If you want to get the stderr output of a command, you would need to
implement something similar to popen(), but which reads from stderr
instead of stdout.

>         2> The Dialog Utility Clears The Background and while it exits it
>            does not Restore The Screen.
>            So I thought to use "scr_dump()" and "scr_restore()" functions
>            in the following way......
> 
> #include<stdio.h>
> #include<ncurses/ncurses.h>

[snipped]

>            But I got the error...
>                 /usr/include/ncurses/ncurses.h 19:unctrl.h No such
>                                 file or directory
> 
>            while Compiling.

Is unctrl.h in the /usr/include/ncurses directory? It should be in
/usr/include, along with ncurses.h.

>         3> How do I set the cursors. I tried the following program

[snipped]

>            But I got the error...
>                 /usr/include/ncurses/ncurses.h 19:unctrl.h No such
>                                 file or directory
> 
>            while Compiling.

This is the same problem as before.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to