obg
asked on
Text attributes with curses
I'm rather new to curses and termcap stuff, but I know C programming quite well. I am working on a HPUX system and try to print reverse video (or anything else than standard gray on black). I try
initscr();
nonl();
cbreak();
noecho();
clear();
attrset(A_REVERSE);
mvaddstr(1, 1, "Testing...");
attrset(A_STANDOUT);
keypad(stdscr, 1);
do {
key = getch();
/* and some other stuff */
} while (key != 'q');
erase();
endwin();
but it comes out like any other text. I know the terminal is capable of displaying reverse text since the man-pages uses it for highlighting. I have tried both default dtterm and vt100 settings.
What am I missing?
initscr();
nonl();
cbreak();
noecho();
clear();
attrset(A_REVERSE);
mvaddstr(1, 1, "Testing...");
attrset(A_STANDOUT);
keypad(stdscr, 1);
do {
key = getch();
/* and some other stuff */
} while (key != 'q');
erase();
endwin();
but it comes out like any other text. I know the terminal is capable of displaying reverse text since the man-pages uses it for highlighting. I have tried both default dtterm and vt100 settings.
What am I missing?
ASKER
Hmm... I have no such routine wcolorout. - Sure you're not using ncurses? Am I using some wierdo version? I have no REVERSE either. :-(
Really it seems to be different versions of curses
ASKER
Yeah. That sucks. I guess neither HP or IBM are that good at maintaing standards. :-(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hey! That works!!! Can you please explain the difference between attrset(A_STANDOUT) and standout()?
None that I know of, but the orig version you posted didn't do A_STDOUT, it did A_REVERSE (the A_STDOUT call is after the call to display the text).
ASKER
Thanks! I know... I interpreted A_STANDOUT as "standard output", not as something that would really stand out...
There is a difference on my system (HPUX), really. (Not on my Linux system, though. attrset(A_STANDOUT); and standout(); seems to be identical on Linux. On the HP however, the attrset() seems to have no effect at all.
Anyway, thanks again!
There is a difference on my system (HPUX), really. (Not on my Linux system, though. attrset(A_STANDOUT); and standout(); seems to be identical on Linux. On the HP however, the attrset() seems to have no effect at all.
Anyway, thanks again!
I use in a curses routine in AIX as follow:
wcolorout(winmenu,REVERSE)