PDA

View Full Version : xterm help



xlordt
09-10-2002, 09:33 AM
ok im running linux RH7.3 and my console can accept colors.. cause itz xterm.. but the problem here is that im coding in ncurses... (i have posted this before but im tring to findout how to use ncurses in my console) but when i try to run the code all i see is just a gray little box on the left hand top corner of my screen so can anyone help me fix this to work on my term... ? thanx here is the code




#include <stdio.h>
#include <ncurses.h>

int main()
{

initscr();
noecho();
cbreak();
start_color();

init_pair(2, COLOR_RED, COLOR_RED);
attron(COLOR_PAIR(2));
wprintf("hello colorz");
refresh();
attroff(COLOR_PAIR(2));


sleep(3);
endwin();
return 0;

}


this damn thing should work ... i never had problems untill i upgraded my version of linux to RH7.3(hade rh 7.2)

Hammer
10-07-2002, 06:31 AM
>>>wprintf("hello colorz");
Try changing this to:
>>printw("hello colorz");

.... works for me, might do for you.

Fredd
10-09-2002, 09:40 AM
#include <stdio.h>

i dont think you need that... if im not mistaking ncurses.h includes it.

try

if(has_colors() ==FALSE) {

to see if your terminal supports colors. if it doesnt that might be the problem :D