GUI Slider value doesnt change

Hi, I created a slider in my GUI. the problen - moving the slider doesnt chage the value (when i am debuging and loocking at handles.slider.value or hObject). when seting the value it does move the slider, but bot the other way around. Please help!
more info:
initialy i set the slider as 'off'. when another buttton activates it. the SliderStep is determened by another parameter in the gui, and is changed all the time.
the min is 0, max is 1.
my code:
function slider_time_Callback(hObject, eventdata, handles)
g = get(hObject, 'Value')
h = get(handles.slider_time, 'Value')
function slider_time_CreateFcn(hObject, eventdata, handles)
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
when g and h are 0 after moving the slider.
THANKS!

3 件のコメント

Geoff Hayes
Geoff Hayes 2019 年 3 月 31 日
Taly - please clarify what you mean by _i set the slider as 'off'_. And are you sure that the callback is being called when you move the slider? You may need to attach an example GUI that exhibits this behaviour.
Taly ZTaly
Taly ZTaly 2019 年 4 月 1 日
i found the problem, thanks. it was the Slider Step. set it to [0.01, /changing value/] and it works.
Rik
Rik 2019 年 4 月 1 日
Also, your callback doesn't actually do something. It creates two variables that are wiped after this function quits.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

質問済み:

2019 年 3 月 31 日

コメント済み:

Rik
2019 年 4 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by