function flag = update_filter_menu

% update_filter_menu - update filter menu for open browsers
% ---------------------------------------------------------
%
% update_filter_menu

%--------------------------------
% Author: Harold Figueroa
%--------------------------------
% $Revision: 1814 $
% $Date: 2005-09-21 15:24:01 -0400 (Wed, 21 Sep 2005) $
%--------------------------------

%--
% get handles to open browser figures
%--

if (nargin < 1)
	h = get_xbat_figs('type','sound');
end

% NOTE: return if there is nothing to update

if (isempty(h))
	return;
end

%--
% destroy and create filter menus
%--

% NOTE: this destroys any filter state information stored in browsers

for k = 1:length(h)
	
	%--
	% find parent menu
	%--
	
	par = findobj(h(k),'type','uimenu','label','Filter');
	
	if (isempty(par))
		continue;
	end
	
	%--
	% kill all children then parent
	%--
	
	try
		delete(allchild(par)); delete(par); 
	end
		
	%--
	% recreate filter menu
	%--
		
	browser_filter_menu(h(k));
	
end