WindowScrollwheelFcn in a GUI

24 ビュー (過去 30 日間)
Stelios Fanourakis
Stelios Fanourakis 2018 年 6 月 10 日
コメント済み: Rik 2019 年 9 月 25 日
I have a GUI consisted of a slider, a press button and 4 axes. I have placed the WindowScrollWheelFcn and I get the following error
"Warning: Setting the "WindowScrollWheelFcn" property is not permitted while this mode is active.
> In matlab.uitools.internal.uimodemanager>localModeWarn (line 211)
In matlab.uitools.internal.uimodemanager>@(obj,evd)(localModeWarn(obj,evd,hThis)) (line 86)
In fresh>Load_image_Callback (line 320)
In gui_mainfcn (line 95)
In fresh (line 42)
In matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)fresh('Load_image_Callback',hObject,eventdata,guidata(hObject)) "
Any help?

採用された回答

Rik
Rik 2018 年 6 月 10 日
You have the target figure open. You probably have the selector mode on (the mouse cursor icon in the menu bar), or maybe the pan mode. You need to have the current mode turned off if you want to initialize some callback that may interfere with it.
The only time I've seen this error myself, is when I wanted to set a ButtonDownFcn while the selector mode was on.
This is an example of why it is generally a good idea to have a GUI as locked down as you can while you set all the properties. (I often even set Visisble to off when initializing to circumvent any user interaction messing up the settings)
  12 件のコメント
Stelios Fanourakis
Stelios Fanourakis 2019 年 9 月 25 日
I used this
As
disableDefaultInteractivity(handles.axes1);
But still the same error
Rik
Rik 2019 年 9 月 25 日
I think it makes more sense to continue this discussion in your new thread. You should also mention which release you're using.
It might also be helpful to attach an example. Make sure to restart Matlab, and describe every step you take from there to reproduce the issue.

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

その他の回答 (1 件)

Steven Lord
Steven Lord 2018 年 6 月 12 日
Before you tried to set the WindowScrollWheelFcn, did you turn zoom on, pan on, or rotate3d on? See the Tips section of the documentation pages for the zoom, pan, or rotate3d functions. Each says "Do not change figure callbacks within an interactive mode." The WindowScrollWheelFcn is a figure callback.

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by