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:
http://www.blender.org/documentation/blender_python_api_2_68a_release/info_tutorial_addon.html?highlight=layout

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

Thanks in advance!!!

Kike

http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/UV/Bake_Texture_to_Vertex_Colors

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