They are called callbacks and you need to use the callback manager for them. I thought this was pretty straight-forward:
http://wiki.esoui.com/AddOn_Quick_Qu...s.22_in_Lua.3F
Is there something in particular that you are stuck on or not understanding?