function aObj = editopen(aObj)
%AXISTEXT/EDITOPEN

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.9 $  $Date: 2000/08/01 22:09:50 $


aObj = set(aObj,'Editing','on');
HG = get(aObj,'MyHGHandle');

% save current changes
ud = getscribeobjectdata(HG);
ud.ObjectStore = aObj;
setscribeobjectdata(HG,ud);

fig = get(get(HG,'Parent'),'Parent');
plotedit(fig,'setsystemeditmenus');
waitfor(HG,'Editing','off');

if ishandle(HG) 
   if ishandle(fig)
      plotedit(fig,'setploteditmenus');
   end
   % aObj may have changed, since there was a click to 
   % deactivate editing
   A = getobj(HG);
   aObj = A.Object;
else
   aObj = [];
   % domymenu.m or @scribehandle/doclick will catch this...
end