GUI Edit Text value update
显示 更早的评论
Hi,
A very simple GUI: Three Edit Text, 'a', 'b' and 'c'. One button in toolbar. The aim is to use toolbar button to do 'add function', i.e. c=a+b.
My problem is: Once I change the numeric value in edit text 'a' or 'b', I have to click somewhere else on the GUI to make this change effective. Otherwise the new value in edit text will not be passed to 'add function' which corresponds to the Clickedcallback function of the toolbar button.
Can anyone help?
Thanks
Yu
回答(2 个)
Walter Roberson
2013-9-16
0 个投票
You are correct. edit boxes (and uitable boxes) are not updated until focus is lost or they are clicked on or return is pressed. Focus would be lost when the toolbar button is clicked on, so updating will happen in that case.
Sean de Wolski
2013-9-16
0 个投票
Hi Yu,
There is a bug in uipushtool that it does not first fire the callback of the edit box. There is a workaround that relies on undocumented functionality. If you contact technical support and reference 1-D3S3VO, they'll be able to help you.
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!