actionPerformed to created button from the scrip

I need to add an actionPerformed/event for my button created on script

import com.inductiveautomation.factorypmi.application.components as obj 

comp = obj.PMIButton()
comp.setName(name)
comp.visible = True
root.addComponent(comp)
system.gui.moveComponent(comp, x-XValue,y)

I need to add an actionPerformed on the scrip.
How?