view arrows/sched_ui.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 672052bd81f8
children
line wrap: on
line source
% 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