Block and un-block items
2 次查看(过去 30 天)
显示 更早的评论
Hello,
in guide I have few pushbuttons, uitables, radiobuttons.....few are enabled and few of them are disabled...
If I press button Calculate, than calculation is executed. During calculation I need disable all items. If calculation is finished, than enabled items before calculation have to be again enabled and disabled items before calculation have to be again disabled.
Haw can I do it?
msgbox? Or is there anything better?
Thank you
0 个评论
采纳的回答
Mischa Kim
2014-2-16
Each object in a GUI has a unique name which you can use to set parameters for. As an example, for a pushbutton you would use:
set(handles.pushbutton,'Enable','on')
set(handles.pushbutton,'Enable','off')
to enable/disable the button with name pushbutton.
3 个评论
Mischa Kim
2014-2-16
Image Analyst
2014-2-16
You can load all your handle IDs into an array and then just call that instead of doing them all individually:
handlesIDs = [handles.pushbutton1, handles.pushbutton2];
set(handlesIDs, 'Enable', 'off');
You just need to assign handlesIDs once at the beginning of your program and then just use it over and over. You can make it global, use setappdata(), or attach the array to handles.
更多回答(1 个)
Jan
2014-2-16
You can disable the complete figure with one command:
- http://www.mathworks.com/matlabcentral/fileexchange/15895-enabledisable-figure
- Under Windows: http://www.mathworks.com/matlabcentral/fileexchange/31437-windowapi - Ups, I see that there is an outdated version in the FEX. I'm going to post a new version soon, which is capable of disabling figures also.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!