Matlab slider when Min=Max=Value=1 -
i use slider browse through collection size changes dynamically , can 1.
but if i:
set(mysld, 'min', 1, 'max', 1, 'value', 1, 'sliderstep', [1 1])
the slider this, so-called thumb half long "trough":
which not okay, because if click on left side of slider, value set zero, i.e. out of range, , slider disappears.
am using wrong property settings?
(of course, set(mysld, 'enable', 'off')
whenever min=max=1, feels hack).
you can use listener check value against min and/or max:
figure; % create uicontrol sl = uicontrol ( 'style', 'slider', 'min', 1, 'max', 1, 'value', 1, 'sliderstep', [1 1]); % create listener check value reset appropriately addlistener ( sl, 'value', 'postset', @(obj,event)set ( sl, 'value', max(sl.min, min(sl.value,sl.max))) );
Comments
Post a Comment