Solved

Text attributes with curses

Posted on 2001-07-03
8
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:obg
ID: 6249029
Yeah. That sucks. I guess neither HP or IBM are that good at maintaing standards. :-(
0
 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

696 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