Hello Daniel!
I understand that whenever you are trying to open the attached app, you are getting the dialog box with “Error loading <project_name.mlapp>”.
I faced the same issue when trying to open the attached app. Please ensure that if your app relies on any external functions or files, make sure all the necessary dependencies are available and accessible. Check if any required files are missing or if the paths to those files are incorrect.
To add a dialog box to popup when a certain button is pressed, you can use the “KeyPressFcn” callback function to achieve the same in the following manner:
function UIFigureKeyPress(app, event)
if strcmp(event.Key, 'a')
% Display a dialog box
uialert(app.UIFigure, 'You pressed the "a" key!', 'Key Pressed', 'Icon', 'info');
end
end
The above code will pop up an info dialog box with the given message upon pressing the ‘a’ key. You can customise the message and key according to your requirements.
For more information on the “KeyPressFcn” callback function, you can refer to the following documentation:
I hope this helps!
Regards,
Nivedita.