|
|
Slider step, value does not agree with setting when sliding vs. using the arrow
Posted:
Mar 1, 2013 4:18 PM
|
|
I setup this slider so that when using the arrow (the minor step) it will move by 1 and when clicking inside the slider (the major step) it will move by 10.
All is ok. But what about when actually sliding the slider itself? In this case, in the callback, I see the value returned is not in steps of 1 as I expected, but in fractions.
If you run this, and look at the console, you'll see it print the current value. When using the arrows, all is ok, but when sliding it by holding the inside stick and sliding it with the mouse, now the steps are no longer using the minor nor the major steps.
------------------------------------ foo=@(hObject,eventdata) disp(get(hObject,'Value'))
f=figure('Units','normalized','position',[.3 .3 .2 .2]); h5 = uicontrol('Units','normalized','style',... 'slider','position',[.3 .3 .5 .2],'parent',f,... 'callback',foo,'Min',0,... 'Max',100,'Value',10,... 'SliderStep',[1/100 10/100]); -------------------------------
Is there an option to control those steps as well? I thought the minor step was what controlled those also?
Using 2012a
thanks, --Nasser
|
|