curses: getting cell attributes.

B

Brian Alexander

Hello;

I am trying to determine all of the cell attributes active on a given
cell of a curses window. I start by getting a value that contains the
attribute and character at the specified location ...

cellValue = windowHandle.inch(y, x)

Now, I have to pull out the attributes (MSB) ...

cellAttr = cellValue & 0x0000FF00

I should be able to test cellAttr for various attributes with bitwise
AND ...

if (cellAttr & curses.A_BOLD) == curses.A_BOLD: doSomething()

Doing this doesn't seem to work. All my cells come out as having the
same selection of attributes, curses.A_NORMAL, even though some are bold.

How do people test for active attributes in curses windows?


Many thanks,

Brian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,915
Members
47,456
Latest member
JavierWalp

Latest Threads

Top