samer@0: function acquire(a) samer@0: ud=get(0,'UserData'); samer@0: i=find(ud.figs==fig(a)); samer@0: if isempty(i) samer@0: ud.figs=[ud.figs, fig(a)]; samer@0: ud.arrows=[ud.arrows,{a}]; samer@0: set(0,'UserData',ud); samer@0: else samer@3: fprintf('Arrow %s [%s] cannot use figure %d, already in use by %s [%s].\n',... samer@3: tostring(a),a.opts.name,fig(a),tostring(ud.arrows{i}),ud.arrows{i}.opts.name); samer@0: error('Figure already in use by arrow.'); samer@0: end samer@0: end