% sched_ui - Create buttons to control scheduler.
function handles=sched_ui(sched,fig)
	clf(fig);
	handles=map(@(fn)mkbutton(getfield(sched,fn),fn),{'start','stop'});
	layout([10,10],handles);
	handles=cell2mat(handles);

	function b=mkbutton(action,text)
		b=uicontrol('Parent',fig,'Style','Pushbutton','String',text,'Callback',@(a,b)action());
	end
end

function layout(pos,handles), foldl(@add_control,pos,handles); end
function cur=add_control(cur,h)
	pos=get(h,'Position');
	set(h,'Position',[cur,pos(3:4)]);
	cur = cur+[0,pos(2)];
end



