Is there anyway to automatically open up a tab that was just generated?

4 ビュー (過去 30 日間)
Chris Gnam
Chris Gnam 2016 年 4 月 8 日
コメント済み: Chris Gnam 2016 年 4 月 8 日
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?

採用された回答

Walter Roberson
Walter Roberson 2016 年 4 月 8 日
If tabgp is your uitabgroup and tabh is your newly created tab, then
set(tabgp, 'SelectedTab', tabh);
drawnow();
  1 件のコメント
Chris Gnam
Chris Gnam 2016 年 4 月 8 日
Thanks! This was exactly what I was looking for!

サインインしてコメントする。

その他の回答 (1 件)

Adam
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)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by