Is there anyway to automatically open up a tab that was just generated?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Chris Gnam
le 8 Avr 2016
Commenté : Chris Gnam
le 8 Avr 2016
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 commentaires
Réponse acceptée
Walter Roberson
le 8 Avr 2016
If tabgp is your uitabgroup and tabh is your newly created tab, then
set(tabgp, 'SelectedTab', tabh);
drawnow();
Plus de réponses (1)
Adam
le 8 Avr 2016
Modifié(e) : Adam
le 8 Avr 2016
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 commentaires
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!