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
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
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.

カテゴリ

質問済み:

2013 年 9 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by