To:

        linux-c-programmer @itis-com

From:

        Aravinda Guzzar H.P

        751/A, 15th 'B' Main Road,

        Gokula 1st stage,Mathikere,

        Bangalore-54



        email -> [EMAIL PROTECTED]



sir,

        sub:clearing of few doubts



        I am final year CSE student studying in M.S.Ramaiah Institute of

Tech. Bangalore.While doing C-programming in LINUX i encountered following

difficulties.





        I am very happy that you replied back to my previous questions very

 soon and I expect the same from you this time.

        



*******************************************************************************

        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

****************************************************************************



        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>



main()

{

        initscr();



        fprintf(stderr,"\nTo demonstrate  screen saving & Restore");

        fprintf(stderr,"\nStrike any key .. Screen is saved");

        getch();

        scr_dump("screen.scr");

        clear();

        printw("\n Press any key to  Restore the screen");

        refresh();

        getch();

        scr_restore("screen.scr");

        getch();

        endwin();

}





           But I got the error...

                /usr/include/ncurses/ncurses.h 19:unctrl.h No such

                                file or directory



           while Compiling.

**************************************************************************



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



#include<stdio.h>

#include<ncurses/ncurses.h>

main()

{

        initscr();

        slk_init();

        fprintf(stderr,"\nInvisible");

        curs_set(0);

        getch();

        fprintf(stderr,"\nvisible");

        cur_set(1);

        getch();

}



           But I got the error...

                /usr/include/ncurses/ncurses.h 19:unctrl.h No such

                                file or directory



           while Compiling.

****************************************************************************



       Expecting the reply as early as possible at my address



       [EMAIL PROTECTED]



       yours faithfully

       Aravinda Guzzar H.P





Reply via email to