From: M Paheerathan on
In MatLAB GUI. In some text boxes I'm entering some values and reading it by using get and then updating it in some other text boxes.

The Problem is, Say When I edit the text box values, If I leave the mouse cursor in a certain text box, that certain text box value is not read
But If I point the cursor somewhere (Cursor focus will be removed from mentioned text box) , then the value is read.

How to tackle this problem?


Thanks in Advance,

Paheerathan
From: Christopher on
"M Paheerathan" <mp.mscproject(a)yahoo.com> wrote in message <i0jlat$m2r$1(a)fred.mathworks.com>...
> In MatLAB GUI. In some text boxes I'm entering some values and reading it by using get and then updating it in some other text boxes.
>
> The Problem is, Say When I edit the text box values, If I leave the mouse cursor in a certain text box, that certain text box value is not read
> But If I point the cursor somewhere (Cursor focus will be removed from mentioned text box) , then the value is read.
>
> How to tackle this problem?
>
>
> Thanks in Advance,
>
> Paheerathan

Hi Paheerathan,

As far as I know, objects such as edit and static textboxes perform their callbacks either when they are unselected (as in the case that you are currently observing) or when you press 'Enter' whilst still in the box.
There is no other way to launch the callback I don't think. So you will either have to ensure the user clicks outside of the current textbox or presses 'Enter' when the value has been finished.

Chris
From: M Paheerathan on
Ooops... is that so?

Thank you very much Chris
From: Markus Leuthold on
have a look at the callbacks of the figure (gcf). There you have
* 'windowkeypressfcn' which is called after keystroke in a textbox (since it's a child of gcf)
* 'windowbuttonmotionfcn': called every time the mousepointer is moved. in conjunction with 'currentpoint', you can check if your pointer leaves the textbox

best regards, Kusi