function newstate = umtoggle(uimenu_handle)
% UMTOGGLE  Toggle "checked" status of uimenu object.
%	UMTOGGLE(U) changes the 'checked' status of the object
%	U from 'on' to 'off' or from 'off' to 'on', and returns
%	1 if the new status is 'on' and 0 if the new status is
%	'off'.

%	Author: T. Krauss 10-14-94
%	Copyright (c) 1995 by The MathWorks, Inc.
%	$Revision: 1.3 $  $Date: 1995/01/17 13:42:57 $

str = get(uimenu_handle,'checked');
if strcmp(str,'on')
   newstate = 0;  newstr = 'off';
else
   newstate = 1;  newstr = 'on';
end
set(uimenu_handle,'checked',newstr)

