Matlab TabPanel的使用
TABSELECTIONFCN(<hFig>,<TabTag>,<tabnumber>)
% <hFig> the handle(!) of the Figure (which contains the tabpanel)
% and not the name of the figure file.
% <TabTag> the Tag name of the tabpanel
% <tabnumber> The number of the tabpanel or the tab string
当我研究 gui 的变量句柄以查找选项卡面板的句柄时,我没有看到它们。如果我打开 gui 的 .fig 文件,它们不会出现,所以我不知道该怎么做才能克服这个问题。
PD 我向该应用程序的作者发送了一封电子邮件,但没有得到答复。
I am trying to use the application TabPanel Constructor v2.8. I have followed the instructions given with it. In the openingfcn of my gui I need to select one of the tabs. For it, I should use the tabselectionfcn which is adjunct with the mentioned application. This function has the following signature:
TABSELECTIONFCN(<hFig>,<TabTag>,<tabnumber>)
% <hFig> the handle(!) of the Figure (which contains the tabpanel)
% and not the name of the figure file.
% <TabTag> the Tag name of the tabpanel
% <tabnumber> The number of the tabpanel or the tab string
When I research for the variable handles of my gui to find handles of the tabpanels, I do not see them. If I open the .fig file of my gui they do not appear, so I do not know what to do to overcome this problem.
P.D. I sent an email to the author of this application but I did not get answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要 tabpanel 句柄,而是需要图形句柄。
GUIDE 创建的图窗的句柄默认是隐藏的。其可见性由 figure 属性
HandleVisibility,它被设置为 GUI 的回调,以保护它们免受命令行用户的影响。该句柄在回调函数内部可见,就像
hObject
是您需要的句柄一样。您可以在与Fig 文件关联的m 文件中找到所有回调函数。您还可以从 GUI 外部打开 Fig 文件获取句柄,
或者您可以使用 FINDALL 通过其属性查找对象(包括隐藏对象):
然后您可以使用 TABSELECTIONFCN 控制选项卡:
tabpanel 标签名称是您用作静态文本对象的
Tag
属性创建时的占位符选项卡面板。如果您在 GUIDE 中打开 GUI 并使用属性检查器检查选项卡面板属性,则可以找到它。这看起来像TBP_myTab
。顺便说一句,如果您确实需要选项卡面板句柄,您也可以使用 FINDALL 获取它们:
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 tocallback
for GUI to protect them from command line user. The handle is visible from inside the callback function, likewhere
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
Alternatively you can use FINDALL to find an object (including hidden) by its properties:
Then you can control a tab with TABSELECTIONFCN:
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 likeTBP_myTab
.By the way, if you do need tabpanels handle you can get them also with FINDALL: