#!/usr/bin/python
import pyatspi

def listener(event):
    print event
    print "has showing: %s" % event.source.getState().contains(pyatspi.STATE_SHOWING)
    print "has visible: %s" % event.source.getState().contains(pyatspi.STATE_VISIBLE)

pyatspi.Registry.registerEventListener(listener, "object:state-changed:visible")
pyatspi.Registry.registerEventListener(listener, "object:state-changed:showing")
pyatspi.Registry.start()
