samer@0: function u=construct(s,sizes_in) samer@0: fg=fig(s); samer@0: current_value = s.x0; samer@0: ht=uitext('parent',fg,tostring(current_value),'left'); samer@0: samer@0: u=mkunit(s); samer@0: u.process=@proc; samer@0: u.sizes_out = {[1,1]}; samer@0: u.dispose = @dispose; samer@0: u.starting = @starting; samer@0: u.stopping = @stopping; samer@0: samer@0: function starting samer@0: set(fg,'ButtonDownFcn',@btndown); samer@0: set(fg,'WindowButtonMotionFcn',[]); samer@0: end samer@0: samer@0: function stopping samer@0: set(fg,'ButtonDownFcn',[]); samer@0: set(fg,'WindowButtonMotionFcn',[]); samer@0: end samer@0: samer@0: function x=proc, samer@0: pos=get(ax,'CurrentPoint'); samer@0: x=pos(1,1:2)'; samer@0: end samer@0: samer@0: function btndown(a,b), set(fg,'WindowButtonMotionFcn',@nop); end samer@0: function btnup(a,b), set(fg,'WindowButtonMotionFcn',[]); end samer@0: samer@0: function dispose samer@0: set(fg,'ButtonDownFcn',[]); samer@0: set(fg,'WindowButtonMotionFcn',[]); samer@0: end samer@0: end