Hi there, that's actually my script on the right.
So it's a mix of spacing and margins.
win.spacing=1; // min spacing between elements. 1 pixel
win.margins=[0,0,0,0] // margins like a picture frame around outermost items and window.
This propogates down to groups and panels, so if buttons in a group, adjust those properties for the panel.
Also you need to be careful about knowing about Automatic layout and hard coding some of this stuff, they may conflict.
I like to hard code some stuff for more control, but it can take longer to bug check and fix than letting it automatically layout.
Peter Kahrel has a good pdf online if you google it and gives a good explanation of all the basic ui concepts.