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

1 view (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Jul 2009
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.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!