________________________________________________________________________
Message: 1
Date: Wed, 29 Dec 2004 06:18:22 +0000 (GMT)
From: ankit chandra <[EMAIL PROTECTED]>
Subject: Help with Ncurses
hi,
Very recently i have come across the curses library
available in Linux. well i was trying to make a few
user interfaces and there was no problem
i tried to accept some data from the user interface it
worked fine except for one glitch, that is i cannot
use the backspace key.
whenever i use the backspace the character to the left
is not deleted instead a new garbage value is
displayed.
i hope someone will help me solve this problem
here is the code fragment.
to compile: cc -lncurses filename.c
Inorder to exit press 'x'
#include<stdio.h>
#include<curses.h>
#include<panel.h>
main()
{
char ch,buff[20];
WINDOW *w1,*w2;
int i=0;
initscr();
start_color();
init_pair(1,COLOR_WHITE,COLOR_GREEN);
w1=newwin(LINES,COLS,0,0);
wstandend(w1);
wbkgd(w1,COLOR_PAIR(1));
wattron(w1,A_BOLD);
wrefresh(w1);
keypad(stdscr,TRUE);
noecho();
while((ch=wgetch(w1)) != 'x')
{
buff[i++] = ch;
wechochar(w1,ch);
wrefresh(w1);
}
mvwprintw(w1,2,4,buff);
wrefresh(w1);
}
________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony
________________________________________________________________________
________________________________________________________________________
Belgaum GNU/Linux Users group... Where Open Minds Meet
------------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ilug-belgaum/
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
linux-india-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-india-help