Solved

Text attributes with curses

Posted on 2001-07-03
8
252 Views
Last Modified: 2013-12-26
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
Comment
Question by:obg
  • 4
  • 2
  • 2
8 Comments
 
LVL 6

Expert Comment

by:bira
ID: 6248868
Hi

  I use in a curses routine in AIX as follow:

 wcolorout(winmenu,REVERSE);
0
 
LVL 2

Author Comment

by:obg
ID: 6248965
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
 
LVL 6

Expert Comment

by:bira
ID: 6249006
Really it seems to be different versions of curses
0
 
LVL 2

Author Comment

by:obg
ID: 6249029
Yeah. That sucks. I guess neither HP or IBM are that good at maintaing standards. :-(
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 14

Accepted Solution

by:
chris_calabrese earned 100 total points
ID: 6249128
Try
...

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

'stand' in curses is not 'standard' but 'standout'.
0
 
LVL 2

Author Comment

by:obg
ID: 6251713
Hey! That works!!! Can you please explain the difference between attrset(A_STANDOUT) and standout()?
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6255506
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
 
LVL 2

Author Comment

by:obg
ID: 6256046
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now