MATLAB: Is the uipushtool callback evaluated before a uicontrol callback in MATLAB 7.7 (R2008b)

MATLAB

I am creating my GUI in which I have several uicontrol objects and a uitoolbar (with uipushtool objects). They have callbacks.
If I am editing an edit object (cursor blinking) and I click on the uipushtool then the uipushtool callback is evaluated before the edit object callback.
The edit object callback should be evaluated first since its content has an influence on the uipushtool callback.
How can I do that ?

Best Answer

The ability to force a UICONTROL callback to be evaluated before a UIPUSHTOOL callback is not available in MATLAB 7.7 (R2008b).
To work around this issue, you can create a flag in the User Datas of your GUI, and then update and check the status of the flag in the different callbacks when needed.
The attached MATLAB file gives an example.
Related Question