# Example of how to detect when Atom display states change.

def got_changes(trigger_name, changes):
    print ('atom change reasons', changes.atom_reasons()) # List of strings, e.g. ['display changed']
    atoms = changes.modified_atoms()	# Atoms object
    print ('modified atoms', len(atoms))

from chimerax.core.atomic import get_triggers
t = get_triggers(session)
t.add_handler('changes', got_changes)
