"Alex " <email@example.com> wrote in message news:firstname.lastname@example.org... > Actually, it seems this is part of the same problem. How would I update > the listener > handles.sliderListener = > addlistener(handles.slider1,'ContinuousValueChange', ... > @(hObject, event) > slider1ContValCallback(... > hObject, eventdata, handles));
You are still passing the COPY of the handles structure into slider1ContValCallback. NO changes you make ANYWHERE to the handles structure will change the copy being remembered by that anonymous function. You can delete the handles structure entirely, and it WILL NOT CHANGE the listener's copy.
If you want slider1ContValCallback to get the most up-to-date copy, retrieve it INSIDE slider1ContValCallback instead of passing it into slider1ContValCallback via anonymous function.
It's like you have a nametag labeled Bob attached to your chest by surgical staples. You can change your name from Bob to whatever else you want -- but people are going to look at that nametag and call you Bob. Instead of doing that, let people ask you your name when they meet you. [Not a great metaphor, but close enough.]