Integrate app within another app

19 visualizaciones (últimos 30 días)
Jackson Collins
Jackson Collins el 5 de Abr. de 2021
Respondida: Harsh Mahalwar el 7 de Mzo. de 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.

Respuestas (1)

Harsh Mahalwar
Harsh Mahalwar el 7 de Mzo. de 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!

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by