Listener not responding to ui slider
I didn’t like how the normal callback implementation on the slider only updated once I stop dragging it, so I tried addlistener instead, but for some reason it just doesn’t respond at all. As a simple example, for the following code
sld = uicontrol(‘Style’,’slider’);
lst = addlistener(sld,’Value’,’PostSet’,@(src,evt)disp(‘value changed’));
Changing the value of the slider directly from the Command Window ( sld.Value=0.5; ) causes the callback function to run, but moving the slider or pressing the arrows on its ends does nothing.
What am I doing wrong?I didn’t like how the normal callback implementation on the slider only updated once I stop dragging it, so I tried addlistener instead, but for some reason it just doesn’t respond at all. As a simple example, for the following code
sld = uicontrol(‘Style’,’slider’);
lst = addlistener(sld,’Value’,’PostSet’,@(src,evt)disp(‘value changed’));
Changing the value of the slider directly from the Command Window ( sld.Value=0.5; ) causes the callback function to run, but moving the slider or pressing the arrows on its ends does nothing.
What am I doing wrong? I didn’t like how the normal callback implementation on the slider only updated once I stop dragging it, so I tried addlistener instead, but for some reason it just doesn’t respond at all. As a simple example, for the following code
sld = uicontrol(‘Style’,’slider’);
lst = addlistener(sld,’Value’,’PostSet’,@(src,evt)disp(‘value changed’));
Changing the value of the slider directly from the Command Window ( sld.Value=0.5; ) causes the callback function to run, but moving the slider or pressing the arrows on its ends does nothing.
What am I doing wrong? callback MATLAB Answers — New Questions