Why this error withthe scrolling wheel function? How can I solve it?

5 ビュー (過去 30 日間)
Stelios Fanourakis
Stelios Fanourakis 2019 年 9 月 24 日
コメント済み: Stelios Fanourakis 2019 年 9 月 24 日
Hi
I use a function called 'WindowScrollWheelFcn' to synchronize the mouse wheel scrolling with the movement of some sliders in the GUI I have built.
The problem is that I get the error
Warning: Setting the "WindowScrollWheelFcn" property is not permitted while this mode is active.
> In matlab.uitools.internal.uimodemanager>localModeWarn (line 226)
In matlab.uitools.internal.uimodemanager>@(obj,evd)(localModeWarn(obj,evd,hThis)) (line 94)
In experiment (line 134)
Where line in the experiment (the main GUI app line)
set (hFig, 'WindowScrollWheelFcn', @mouseScroll);
Why this line is wrong? What does Matlab mean by not permitted while this mode is active?

回答 (1 件)

Steven Lord
Steven Lord 2019 年 9 月 24 日
As per the Tips section on the zoom function documentation page, you cannot change most figure callbacks while an interactive mode (like zooming or panning) is active. The WindowScollWheelFcn is one of the figure callbacks you cannot change while in interactive mode.
In particular, the scroll wheel has a specific function in the zoom interactive mode.
  1 件のコメント
Stelios Fanourakis
Stelios Fanourakis 2019 年 9 月 24 日
I understand your concept. How can I fix it though? I want the scroll wheel to synchronize with the sliders. It used to work.

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

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by