How to reset the static text box each time i press the run button
Mostrar comentarios más antiguos
Hey so I have a static text box that after my code has run (after I push the run button) displays "DONE". I want the displayed message to revert back to "-" after I press the run button again so that it is clear when the code is done running. I've been using
pause(4)
then
set(handles.editbox1,'string','-');
to reset it after 4 seconds, but this is not helpful if you leave come back and the result is still the same (i.e. can't tell that it ran).
Respuestas (2)
Azzi Abdelmalek
el 29 de Ag. de 2013
0 votos
Where did you put those 3 lines of code? Maybe they are in the static text callback which is wrong
3 comentarios
Alex
el 29 de Ag. de 2013
Azzi Abdelmalek
el 29 de Ag. de 2013
What do you mean by: if you leave come back
Alex
el 29 de Ag. de 2013
Image Analyst
el 29 de Ag. de 2013
0 votos
Then the only way is to either leave it as "Done", or put up a messagebox to tell the user, because your program that set the label to "Done" and then sets it to "-" 4 seconds later can't possibly know when your user returns to the computer. With either of those ways, the user will know your code has finished. They might also surmise that it's finished if you set it to "-" if, when it's running, you have the info text label say "processing...." while it's running or put up a progress bar. If they don't see "processing..." or the progress bar, and instead see the "-" or "Done" or message box, then they'll figure that it's done. Anything wrong with that?
3 comentarios
Alex
el 29 de Ag. de 2013
Alex
el 29 de Ag. de 2013
Image Analyst
el 29 de Ag. de 2013
Sometimes it gets into a function so intensive that the message to update the label doesn't get executed until much later. Try putting a "drawnow" after every call to set(). That should force the update to happen, so that when you press the button again it will show the "processing" string.
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!