samer@0: % sched_ui - Create buttons to control scheduler. samer@0: function handles=sched_ui(sched,fig) samer@0: clf(fig); samer@0: handles=map(@(fn)mkbutton(getfield(sched,fn),fn),{'start','stop'}); samer@0: layout([10,10],handles); samer@0: handles=cell2mat(handles); samer@0: samer@0: function b=mkbutton(action,text) samer@0: b=uicontrol('Parent',fig,'Style','Pushbutton','String',text,'Callback',@(a,b)action()); samer@0: end samer@0: end samer@0: samer@0: function layout(pos,handles), foldl(@add_control,pos,handles); end samer@0: function cur=add_control(cur,h) samer@0: pos=get(h,'Position'); samer@0: set(h,'Position',[cur,pos(3:4)]); samer@0: cur = cur+[0,pos(2)]; samer@0: end samer@0: samer@0: samer@0: