Range Slider bug when moving sliders

Hi all,
I'm trying to use the Range Slider in app designer:
fig = uifigure;
sld = uislider(fig,"range");
But even the above minimalistic example results in the following error as soon as I drag one of the sliders:
Error in executing callback registered with ViewModel:
No public property 'PrivateValue' for class 'RangeSlider'.
I'm using a MacBookPro M2 and 23.2.0.2320655 (R2023b) Prerelease Update 3 and wondering if the problem is Apple silicon specific or if this is a general problem. Either way, I would much appreciate any inputs on how to solve this.

 Accepted Answer

Found the answer to my problem when digging in the code of the app designer components. The property access of the LimitedRangeValueComponent class (found in the folder toolbox/matlab/uicomponents/uicomponents/+matlab/+ui/+control/+internal/+model/+mixin) might be buggy.
The current code of LimitedRangeValueComponent is:
properties(Access = {?matlab.ui.control.internal.model.LimitedValueComponent, ...
?appdesservices.internal.interfaces.controller.AbstractController})
% Internal properties
%
% These exist to provide:
% - fine grained control to each properties
% - circumvent the setter, because sometimes multiple properties
% need to be set at once, and the object will be in an
% inconsistent state between properties being set
PrivateValue = [0 100];
end
Changing it to the following fixes the problem
properties(Access = public)
% Internal properties
%
% These exist to provide:
% - fine grained control to each properties
% - circumvent the setter, because sometimes multiple properties
% need to be set at once, and the object will be in an
% inconsistent state between properties being set
PrivateValue = [0 100];
end
Not an elegant solution, but it works.

More Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products

Release

R2023b

Community Treasure Hunt

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

Start Hunting!