We're using curses library functions to draw windows in our project. For showing an error the error message is enclosed within '-'s , it seems to be working fine till we ported to a new linux machine where its displaying some garbage instead of the '-' . To be honest the code is vast and i dont think there's anything wrong with it, seems like there's some configuration problem with some curses path. the ASCII value of '-' is defined in something like 'ACS_HLINE' macro.

i know there's very little info and not too clear. But this is the best i could get, if anyone has any clue please reply.

what is the default output locale on the machine?
are you using something like hline( std::cout.widen( '-' ), n ) ; or whline( window, std::cout.widen( '-' ), n ) ; to draw these lines?

Hi Vijayan,

On some digging up i found that the window is not made up of garbage but rather from the values taken up from curses.h file.

#define ACS_HLINE NCURSES_ACS('q') /* horizontal line */
#define ACS_VLINE NCURSES_ACS('x') /* vertical line */

however we have written a wrapper around this and are setting our own values for these Macros

#define ACS_HLINE TEXT('-')

but these values are either getting over-written or not getting applied at all. Seems like some issue with how the files are included. I think it's a very intrinsic issue related to our code.

Thanks a lot for your time.

> however we have written a wrapper around this and are setting our own values for these Macros
> #define ACS_HLINE TEXT('-') have you rebuilt the library (libcurses or libncurses) with these wrappers?
and perhaps the macro should be just #define ACS_HLINE '-'

Yes we did that, and then later in one of the files the includes were not proper. after doing that the code is working fine , atleast for now. We've decided to look into it in detail again in future. What it did though is that my interest in the curses library has grown and i downloaded it on my laptop and have started to use it. Going slightly off-topic can you suggest some cool things that i can try using curses, basically what is the main use of the curses library?

For all those graphic characters you are completely at the mercy of the terminfo database, which is often enough incomplete in that respect.

I typically just set the graphic characters to a nice combination of minus, pipe, and plus (-, |, +) in my initialization code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.