Is there anyway to automatically open up a tab that was just generated?
5 次查看(过去 30 天)
显示 更早的评论
I have been working on a code for awhile now that automatically imports a large number of .csv files, decides which curve fit is the best option, and then integrates that function and plots both the fitted curve and its integral in a tab. As it goes down my list of files, it creates a new tab for each file (each with the plots of the fitted curve and integral).
From a purely aesthetic point of view, I would really like it if every time a new tab was created, the gui automatically opened that one. Because, currently, while the program is running (and it can take about 5 minutes), it stays open only on the first tab, as each new tab slowly pops into existence. (Don't worry, I have a wait bar so that the user knows not to touch anything!)
But is that possible? Is it possible to have the GUI automatically open up a tab that was just created?
0 个评论
采纳的回答
Walter Roberson
2016-4-8
If tabgp is your uitabgroup and tabh is your newly created tab, then
set(tabgp, 'SelectedTab', tabh);
drawnow();
更多回答(1 个)
Adam
2016-4-8
编辑:Adam
2016-4-8
hTabGroup.SelectedTab = hUiTab;
will programmatically set the current tab, assuming hTabGroup is your uitabgroup and hUiTab is the handle of the uitab object you have just created.
I don't think the GUI can react to the creation of a tab, as such, but you can manually set the tab like this immediately after creating your new tab.
Note: This syntax works from R2014b onwards. For earlier releases you need to use Walter's syntax (which will also still work in later versions)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!