[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] Re: Binand's program



Rajesh J Advani forced the electrons to say:
> 
> BTW, which is the best place to learn ncurses programming? Except the man
> pages. My first program - which did nothing - did not run (I mean it gave
> some error, can't remember what). So if I had a simple 'Hello World'
> example to start on, I could continue on my own.
> 

Well, the best place _is_ the man pages. Looking into the source code of 
some curses based applications will help.

Without the precise error message, I cannot help you. But, a few pointers:

1. You should call initscr() at the beginning of the code.
2. After you make any changes to any of the windows (stdscr or windows you
	create), you should call refresh() or wrefresh().
3. You should call endwin() at the end (and in your signal handlers as well).
4. You should be trapping SIGWINCH.

I have some example code, but don't have access to them right now. Maybe
tomorrow, if you are really interested. The source code of ncurses library 
has a few good programs, which are very instructive.

Also, there is a book on curses programming, the name of which has slipped my
mind now. A search on Amazon.com would be productive.

Binand

- -- 
#include <stdio.h>                                   | Binand Raj S.
char *p = "#include <stdio.h>%cchar *p = %c%s%c;     | This is a self-
int main(){printf(p,10,34,p,34,10);return 0;}%c";    | printing program.
int main(){printf(p,10,34,p,34,10);return 0;}        | Try it!!
- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/
The Linux India mailing list does not accept postings in HTML format.

------------------------------