Solved

Text attributes with curses

Posted on 2001-07-03
8
258 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 94
Detect CR LF to each line 12 170
Prevent this page from creating additional dialogs. 3 613
Use of condition with 'serial' in ansible 2 70
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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