curses: getting cell attributes.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian Alexander

    curses: getting cell attributes.

    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.in ch(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.

Working...