Making ScriptUI Buttons Do Something
The scriptUI builder from Joonas has reduced the amount of time that it takes to create a GUI, which is fantastic.
Presuming that I have my code already working without a GUI, I am really struggling to work out how to test and link up a function or other "result" to the GUI elements in the window.
Take for example this code, it is a simple test, it only has two radio buttons and an OK and Cancel button.

I have worked out how to test and return that it is "true" if a radio button is selected. This also works the same for checkboxes. All good so far.
However, I don't know what to do with the OK and cancel buttons. If I select a radio button and cancel, the function called by the button is executed. Obviously the expectation is that if cancel is pressed, then nothing happens.
Do I need to do anything for the OK button?
I am finding it hard looking at existing code and have not had much success with othe resources such as forum searches.
There must be a resource that simply explains this stuff with working examples? It is taking hours of research for me to get a UI element to do something correctly, so am I missing a basic resource?
This is of course just the start of my questions, there are many different UI controls (dropdowns, fields etc)... Which I'll get to.

