Continuously pressing GUI slider arrow causes hanging
조회 수: 2 (최근 30일)
이전 댓글 표시
I've created a GUI with slider controls. When I make distinct individual clicks of the slider arrows, it works fine. When I hold the arrow buttons down continuously, however, the slider GUI freezes. I can continue to move the slider, but it has no effect on the rest of the GUI.
What appears to be happening is that by holding down the arrow, the slider callback gets launched many times repeatedly and faster than MATLAB can refresh the GUI graphics with the effect of the slider change. Ultimately, it chokes and cannot catch up.
Is there some way that the continuous-arrow-press condition is supposed to be processed? I notice that sliders have a ButtonDownFcn property, but I don't know what role it's supposed to play.
Or might there be some way to force the GUI to wait until all other graphics and uicontrol data in the figure are refreshed before re-executing the callback?
댓글 수: 0
채택된 답변
Sean de Wolski
2012년 10월 4일
The ButtonDownFcn is disabled if the uicontrol is enabled. What is the BusyAction of the slider? If it is cancel that is self explanatory. Else I would suggest adding a drawnow in the callback to force a flush of the event queue.
댓글 수: 4
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!