필터 지우기
필터 지우기

how can I make a GUI control (e.g. slider) respond to a change in the workspace variable?

조회 수: 2 (최근 30일)
Is there a way to make a GUI control, e.g. slider, or a label, or text box to respond to a change of the workspace variable without explicitly setting it properties every other place in the application that changes that variable?
I am constrained to do it in R2011, so the newer version's class event/listener feature is not available.
  댓글 수: 2
Stephen23
Stephen23 2017년 11월 3일
편집: Stephen23 2017년 11월 3일
Short answer: no.
Long answer: write a class for that variable, and set a listener.
Trivial answer: write a little function that sets the slider. Call it everywhere where the variable is changed.
Alternative answer: write object oriented code, and have one method that sets the value and changes the slider.
Michael
Michael 2017년 11월 3일
Can you elaborate on the "Long answer"? a codelet would be helpful, or a pointer to the Reference. Thanks...

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by