In working with MATLAB's uitab
, I had two specific questions:
How do I remove a tab that has been created using
uitab
function?How do I clear the contents of such a tab (including diagrams, buttons, etc.) without deleting the tab itself?
In working with MATLAB's uitab
, I had two specific questions:
How do I remove a tab that has been created using uitab
function?
How do I clear the contents of such a tab (including diagrams, buttons, etc.) without deleting the tab itself?
In order to remove a uitab
from a uitabgroup
but not delete the graphics object, you can change the 'Parent'
property to []
.
hgroup = uitabgroup();
htab = uitab(hgroup, 'Title', 'Tab');
button = uicontrol('Parent', htab, 'String', 'Button');
% Don't show the uitab
set(htab, 'Parent', []);
Then if you want to display the tab again, change the 'Parent'
property back to the tab group that you'd like it to belong to.
set(htab, 'Parent', hgroup)
If you want to clear a tab, you can delete all of the 'Children'
of that tab
delete(get(htab, 'Children'))