?
Solved

Text attributes with curses

Posted on 2001-07-03
8
Medium Priority
?
270 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 300 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

741 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