create copies of the same gui under different tabs

Hello everyone,
I'm new to matlab's app designer and making guis. I have made a gui for plotting a bunch of heatmaps in a way i like them, but during experiments, i need to look at multiple such GUI plots and potentially even combine them into a single plot. Currently I have been opening mulitple instances of the same gui using run xxx, and loading different data into each for their respective plots. I was wondering if I can use something like tabs within a single app window (like a browser), where i can open multiple independent instances of the same GUI (so i can load different data into each tab manually) and also have the ability to share some data across these mutliple instances - say to get an aggregate plot over 2-3 tabs. In other words, I just need help with making multiple copies of the same gui so i can avoid having to rewrite / copy paste multiple call back functions for each tab.
Thanks in advance !!

3 Comments

Isn't this what the duplicate option does when right clicking in design view? not on the fly, but you can set everything up and then duplicate and app designer automatically generates all the code.
so if i have a tab, in App designer, i go to the designview, find my tab, right click it, and select duplicate. Then a new tab with all the same uicontrols and buttons and boxs and things pops into existence, and appdesigner duplicates all the code, but instead of Mybutton, Myswitch, you get Mybutton_2, MySwitch_2
do it again and get Tab_3 with Mybutton_3 and Myswitch_3.
so if you know you need at most to have 5 seperate datasets and analysis windows, then use the duplicate option to duplicate one tab afer you get it how you like, and all the code should autopopulate. then when you run the app, in the one app, you have five tabs that each do the same thing, independently. But idk if you can then add a new tab super easily to the existing five.
however, I have noticed that App designer can get slow when tabs multiply, i rewrote my image analysis app to pop up its results in new figures that are generated and closed programmatically, and it's much faster, but if you aren't noticing a slow app, then your taskbar real estate may be worth it
Hi Michael,
Thanks for your response!
I literally tried that exact option you suggested before asking the question. My issue is exactly as you pointed out: MyButton and MyButton_2 is a problem because then I have to assign all the same call back functions once again in the code view. If I have 10-15 different call backs for tab1 then I have to rewrite a bunch of code that will replicate exactly the callbacks for tab2 since the variable names/ plot axis names etc are different.
What I was hoping to get it is by duplicating the tab, I get 2 copies of the same gui with identical functions and callbacks that operate independently , I e. MyButton_2 (from the duplicated tab) copies the callback property of MyButton from the first tab. That would save me a whole lot of time since I'm planning to duplicate the tab atleast 4 times.
> I just need help with making multiple copies of the same gui
The goal is unclear. A gui is just a guided/graphical user interface. So it's unclear what you want to copy. It's also unclear why you need to copy something rather than developing it within app designer.

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products

Release

R2019b

Asked:

on 19 Apr 2021

Edited:

on 20 Apr 2021

Community Treasure Hunt

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

Start Hunting!