Is there anyway to automatically open up a tab that was just generated?
4 ビュー (過去 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!