function updateVisibility(this)
%Helper method for uitab

%   Copyright 2004 The MathWorks, Inc.
%   $Revision: 1.1.6.1 $  $Date: 2004/12/20 16:45:38 $
tabgroup = get(this, 'Parent');
children = handle(get(tabgroup, 'Children'));
index = find(children == this);
if (isempty(index))
    return;
end

this.OKToModifyVis = true;
if (index == get(tabgroup, 'SelectedIndex'))    
    this.Visible = 'on';      
else    
    this.Visible = 'off';
end
this.OKToModifyVis = false;