Option to return spacewin as output arg from spacewin_gui
I think this would work as follows (pseudocode):
function [varargout] = spacewin_gui(W,NmVal)
if numel(varargout) > 0
if NmVal.FigHandle
varargout{1} = fig;
else
uiwait(close_button); % wait until the "close" button is pressed. Or "done" or something.
varargout{1} = spacewin;
delete(fig);
end
end