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.
How do I automatically update the text in an edit box?
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!