Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

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?
0
obg
Asked:
obg
  • 4
  • 2
  • 2
1 Solution
 
biraCommented:
Hi

  I use in a curses routine in AIX as follow:

 wcolorout(winmenu,REVERSE);
0
 
obgAuthor Commented:
Hmm... I have no such routine wcolorout. - Sure you're not using ncurses? Am I using some wierdo version? I have no REVERSE either. :-(
0
 
biraCommented:
Really it seems to be different versions of curses
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
obgAuthor Commented:
Yeah. That sucks. I guess neither HP or IBM are that good at maintaing standards. :-(
0
 
chris_calabreseCommented:
Try
...

  standout();
  mvaddstr(1, 1, "Testing...");
  standend();

'stand' in curses is not 'standard' but 'standout'.
0
 
obgAuthor Commented:
Hey! That works!!! Can you please explain the difference between attrset(A_STANDOUT) and standout()?
0
 
chris_calabreseCommented:
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).
0
 
obgAuthor Commented:
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!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now