What is the difference between valuechangedfcn and valuechangingfcn?

Some data entry window functions have the option to select a callback with options "valuechangedfcn" and "valuechangingfcn". I have used the valuechangedfcn callback to do something after the GUI user changes the value in that field. But, I don't know what valuechangingfcn is used for. Is that for doing something when a user clicks within the field and has not yet finished entering the new value, and the GUI would do something during that time? What would be an example?... Maybe pause an execution that is underway?

 채택된 답변

Kevin Holly
Kevin Holly 2022년 6월 7일

1 개 추천

Let's say it is a slider. "valuechangedfcn" would occur after you finished dragging the slider and let go on a new value. "valuechangingfcn" would occur while you are dragging the slider.

댓글 수: 3

Is it safe to assume that 'ValueChangedFcn' will betriggered after 'ValueChangingFcn' 'ENDS" when the dragging or turning of the slider or the knob is terminated? What action/event could define the "END" of the dragging/turning action?
If you are dragging a slider with a left mouse button. Letting go of the left mouse button would end 'ValueChangingFcn' and trigger 'ValueChangedFcn' if it lands on a new value. So, I would say letting go of the mouse button you are holding down would "END" it.
Makes sense. Thanks

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

추가 답변 (1개)

Matt J
Matt J 2022년 6월 7일
편집: Matt J 2022년 6월 7일

2 개 추천

Is that for doing something when a user clicks within the field and has not yet finished entering the new value, and the GUI would do something during that time? What would be an example?
Suppose you wanted to implement some sort of autocomplete feature. As the user types characters into an edit-text field, its valuechangingfcn can have a different edit box display suggested completions.

댓글 수: 2

Matt J
Matt J 2022년 6월 7일
편집: Matt J 2022년 6월 7일
Attached is a simple example app where as you enter text in one box, the valuechangingfcn prints it capitalized in another box. When you type enter (or click elsewhere on the app canvas) to finalize the text, the valuechangedfcn adds an exclamation point:
Thanks a lot tha was helpfull@Matt J

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

카테고리

도움말 센터File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

Community Treasure Hunt

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

Start Hunting!

Translated by