You don't need tabpanel handle, but figure handle.
The handle for figure created by GUIDE is hidde by default. Its visibility is controlled by figure property HandleVisibility
, which is set to callback
for GUI to protect them from command line user. The handle is visible from inside the callback function, like
yourgui_OpeningFcn(hObject, eventdata, handles, varargin)
where hObject
is the handle you need. You can find all callback functions in the m-file associated with the fig-file.
You can also get the handle from outside the GUI opening the FIG file as
fh = openfig('yourgui.fig');
Alternatively you can use FINDALL to find an object (including hidden) by its properties:
fh = findall(0,'type','figure'); %# all open figures including GUIs
fh = findall(0,'name','yourgui'); %# find by name
Then you can control a tab with TABSELECTIONFCN:
tabselectionfcn(fh,'myTab') %# get the tab status
tabselectionfcn(fh,'myTab',2) %# activate the 2nd tab
tabselectionfcn(fh,'myTab',1,'off') %# disable the 1nd tab (if not active)
The tabpanel Tag name is the Tag
property of the static text object you used as a placeholder while creating the tabpanel. You can find it if you open your GUI in GUIDE and inspect the tabpanel properties with Property Inspector. That will look like TBP_myTab
.
By the way, if you do need tabpanels handle you can get them also with FINDALL:
htab = findall(fh,'tag','TBP_myTab');