import pyatspi

def adc(event):
    child = event.any_data
    try:
        table = child.parent.queryTable()
    except:
        print "no table"
        return

    index = child.getIndexInParent()
    row = table.getRowAtIndex(index)
    for i in range(0, table.nColumns):
        cell = table.getAccessibleAt(row, i)
        print cell, cell.getState().contains(pyatspi.STATE_SHOWING)

pyatspi.Registry.registerEventListener(adc, "object:active-descendant-changed")

pyatspi.Registry.start()
