How to control GUI with external m-file

6 views (last 30 days)
I created a GUI, named 'StartEngine', there is a button 'Run'(handles.pushbutton1) on the GUI.
Now, I opened the GUI and I want to make Background color of this button to be gray with a m-file.
It means how could I implement the following command out of StartEngine.m (corresponding to StartEnge.fig)
set(handles.pushbutton1, 'BackgroundColor', [0.5, 0.5, 0.5]);
Walter Roberson
Walter Roberson on 18 Dec 2019
figs = findall(0, 'type', 'figure');
get(figs, 'Name')
get(figs, 'Tag')

Sign in to comment.

Accepted Answer

Leo Zhai
Leo Zhai on 18 Dec 2019
I figure out an alternative solution, which do NOT use "control GUI with external m-file" but use "GUI control itself with feedback of external m-file"
Before, I thought the GUI(StartEngine.m) and the external m-file(ExcuteRun.m) run parallel, GUI will not "wait for" the external m-file runing to end and get its result/output.
Now, I found the code is "single-thred", GUI will continue after external m-file run to end.
By the way, I did not find error until now. I wonder if some risk exists using this way.
Leo Zhai
Leo Zhai on 19 Dec 2019
Thanks for your greate advice, I will think through it.

Sign in to comment.

More Answers (0)



Community Treasure Hunt

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

Start Hunting!