addon:first, reading data, then executing code

Hi guys:

I have a script in python that works nicely and I want to turn it into an addon.

The thing is that my code must read some data, make some calculations and then (via a button or something alike) execute some code. All the addons I’ve seen so far, first execute the action, and then allow you to change the settings.
For example the Cursor Array example:

Can anyone tell me about an addon that works like I want mine to work?

Thanks in advance!!!


It let’s your set the alpha color beforehand using a global property.