Clear Filters
Clear Filters

Integrate app within another app

19 views (last 30 days)
Jackson Collins
Jackson Collins on 5 Apr 2021
Answered: Harsh Mahalwar on 7 Mar 2024
I have two MATLAB apps built and packaged. Is there a simple way to incorporate the App B within a new tab of App A. I've followed the documentation regarding making Multi-window apps (https://www.mathworks.com/help/matlab/creating_guis/creating-multiwindow-apps-in-app-designer.html), and I can call the second app and generate a new window from the first app, but I would like to open second app (or set the UIFigure) to the first app and contain the whole interface within window. Is there a simple way to modify the parent or parent container of the Matlab app object?
Thanks.

Answers (1)

Harsh Mahalwar
Harsh Mahalwar on 7 Mar 2024
Hi Jackson,
From what I can gather, you are trying to incorporate App A with App B in such a way that when App B is opened from App A, App B opens on the same window as App A.
Here’s a workaround I was able to find to do the same:
Step 1: Add tab groups to App A (You can find tab groups in containers section)
Step 2: Strech the tab group window vertically so that tab labels aren’t visible in the main window.
Step 3: Add a callback to the button of your choice to switch between tabs.
% Button pushed function: app1Button
function switchTheTab(app, event)
set(app.TabGroup, 'SelectedTab', app.Tab2)
end
The primary drawback of this workaround is that your application will not adjust dynamically to screen sizes, and attempting to modify the window dimensions of your app may result in the visibility of the tab labels.
To tackle this, you can add an event listener which should change the size of the tab group when the size of the window is changed, this can be done using the SizeChangedevent name.
Learn more about tab groups and event listeners using the following links:
I hope this helps, thanks!

Categories

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

Community Treasure Hunt

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

Start Hunting!