believe it or not, the answer is in the
tutorial you have very likely read by vektorboson. the answer lies in the 'action' part of your class definition.
for example, i have a dialogue which has three choices in a drop down menu. the select button at the bottom has the following action:
action = "closeDialog 0;[] exec {satcomm_image.sqs} ";
which closes the dialogue and runs the script. the script contains all the stuff which senses what has been selected in the dialogue. you'll get the hang of it - the tutorial is very well written