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

 Réponse acceptée

Mischa Kim
Mischa Kim le 16 Fév 2014

1 vote

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 commentaires

john
john le 16 Fév 2014
Hello Mischa,
I know about 'Enable','off'. But I have many objects...I hope, there is some other option. I would like to use behavior of msbox.....during calculation
Mischa Kim
Mischa Kim le 16 Fév 2014
OK. In this case check out this blog, which provides several options to solve your problem.
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.

Connectez-vous pour commenter.

Plus de réponses (1)

Jan
Jan le 16 Fév 2014

1 vote

You can disable the complete figure with one command:

Catégories

En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by