Help with Ncurses
From: Ankit (ankit42001_at_yahoo.com)
Date: 12/29/04
- Previous message: Saurabh Aggrawal: "Re: Linking error - .def file problem - DllCanUnloadNow"
- Next in thread: Ulrich Eckhardt: "Re: Help with Ncurses"
- Reply: Ulrich Eckhardt: "Re: Help with Ncurses"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Dec 2004 22:31:06 -0800
hello everyone,
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);
}
- Previous message: Saurabh Aggrawal: "Re: Linking error - .def file problem - DllCanUnloadNow"
- Next in thread: Ulrich Eckhardt: "Re: Help with Ncurses"
- Reply: Ulrich Eckhardt: "Re: Help with Ncurses"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|