Effacer les filtres
Effacer les filtres

How do I automatically update the text in an edit box?

1 vue (au cours des 30 derniers jours)
Hannah
Hannah le 18 Avr 2013
So i have a variable totalMax that updates every time a check box is checked. There are 9 check boxes, and each update the table in certain ways, which then updates totalMax. (this happens in a seperate function I wrote, and each checkbox call back function executes it).
Currently I print totalMax into a string using sprintf and then save it into an GUI object = using this function:
function handleNewMax(handles, new_max)
handles.maxCap = new_max;
guidata(handles.output, handles);
And in the edit box call back function i do this:
handles = guidata(handles.output);
set (hObject, 'String', handles.maxCap);
It works out fine and everything. BUT it only will update if i press enter in the box. Is there a way to have the text box automatically update, specifically if I update totalMax? (or teh string i put it in)?
Thanks

Réponse acceptée

Hannah
Hannah le 19 Avr 2013
OH i just realized, it is simpler that i thought it was. So i have been looking for solutions to this problem and it seemed so simple just put 'set(handles.edit3, 'String', Maxcfs_str)' but there were issues. But I put this in a function I wrote,and there were issues accessing handles.edit3. BUT if I pass in hObject, eventdata, and handles, into the custom functio i wrote, the set function works fine.

Plus de réponses (0)

Catégories

En savoir plus sur Data Distribution Plots dans Help Center 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