www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@xregGui/@PointerRepository/pSetAndUpdate.m
function pSetAndUpdate(pr, fH, varargin) %PSETANDUPDATE Set pointer properties on figure. % % PSETANDUPDATE(PR, FH, PROP, VAL, ...) sets the properties specified on % the figure and ensures that changes to the pointer properties are made % visible. The {PROP,VAL} pairs may be replaced with a structure that % can be used in a call to SET. % Copyright 2008 The MathWorks, Inc. ptr = get(fH, 'Pointer'); ptrcdata = get(fH, 'PointerShapeCData'); set(fH, varargin{:}); ptr_new = get(fH, 'Pointer'); ptrcdata_new = get(fH, 'PointerShapeCData'); % Only issue a drawnow at all if the pointer has actually changed in the % figure. if (~strcmp(ptr, ptr_new) ... || (strcmp(ptr_new, 'custom') && ~isequal(ptrcdata, ptrcdata_new))) % Flush the change without doing any HG refresh or flushing the event % queue. drawnow('update'); end