Daniel, take a look at this sample. It basically does what u want:
Money lines are here:
(ps, this is a MapTool not a Button. There is no callback for a button)
Have you been able to figure this out? I've been trying to figure this out and still unsure