How do I trigger another callback in GUIDE from inside a particular callback?

I have created two edit boxes in GUIDE and would like to trigger the callback for the one of them whenever the callback for the other is triggered. I would like to do this to enable error-checking in my application, as the inputs to the two edit boxes are dependent on each other.

 採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 7 月 7 日
Apart from triggering a callback by interacting with the GUI component, the callback can be directly called from inside the callback of the other component. The syntax should be exactly the same as that used by GUIDE when a callback is called for a particular component. Insert the following line of code into the callback of the caller component:
CalledComponent_Callback(handles.CalledComponent, [], handles)
Here, 'CalledComponent' is the 'tag' for the component whose callback is called. This is the equivalent of 'hObject'. The 'eventdata' argument is empty.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFoundation and Custom Domains についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by