function setstatus(figHandle, string)
%SETSTATUS Set status text string in figure.
%  SETSTATUS(FIGHANDLE, STRING) sets the 'String' property
%  of the uicontrol text object with 'Tag' equal to
%  'Status', if one exists.
%
%  SETSTATUS(STRING) is equivalent to SETSTATUS(gcf,
%  STRING). 
%
%  See also GETSTATUS.

%  Steven L. Eddins, 1 July 1994
%  Copyright (c) 1984-98 by The MathWorks, Inc.
%  $Revision: 1.11 $  $Date: 1997/11/21 23:49:38 $

error(nargchk(1,2,nargin));

if (nargin == 1)
  string = figHandle;
  figHandle = gcf;
end

statusBar = findobj(get(figHandle, 'Children'), 'flat', 'Tag', 'Status');
if (~isempty(statusBar))
  set(statusBar, 'String', string);
end
