Is there a way I can use a different file for the callback function for an object I made using GUIDE?
3 views (last 30 days)
Show older comments
Amit Singh
on 3 Jun 2018
Commented: Walter Roberson
on 3 Jun 2018
Is there a way I can use a different file for the callback function using GUIDE like the way I can use a different file when I code a gui file without guide using the 'callback' attribute?
0 Comments
Accepted Answer
Walter Roberson
on 3 Jun 2018
Not directly. You have to use the GUIDE-generated callback structure to call upon whatever code you want. GUIDE controls the Callback properties in order to pass the handles structure properly.
I guess you could have the GUI OpenFcn callback change the Callback property to refer directly to the external function, but I'm not sure it is worth the trouble.
2 Comments
Walter Roberson
on 3 Jun 2018
global variables are global no matter which file they are used in, provided they are declared as global.
But we do not recommend global variables.
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps 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!