如何解决在 matlab 中禁用可自定义的行
我有一些工作可以根据一些按钮在 App Designer Matlab 中绘制一些线条。 我遵循了文档并能够创建一些行(可自定义)。
在这种情况下,我没有找到任何方法来停止自定义,即锁定直到按下按钮更改/重置。
根据文档,我可以使用 InteractionsAllowed 的属性并将其设置为“无”。但是即使点没有改变,线仍然可以移动或改变。
有没有办法完全禁用更改直到再次启用?
这是我的一些代码:
% Button pushed function: Button_3
function Button_3Pushed(app,event)
app.h1 = drawline(app.ScGambar,'Color','g','Label','Button 3');
addlistener(app.h1,'MovingROI',@app.allevents);
addlistener(app.h1,'ROIMoved',@app.allevents);
end
% Button pushed function: Button_4
function Button_4Pushed(app,event)
app.h2 = drawline(app.ScGambar,'r','Button 4');
addlistener(app.h2,@app.allevents);
addlistener(app.h2,@app.allevents);
end
% Button pushed function: Button_5
function Button_5Pushed(app,event)
app.h1.InteractionsAllowed = 'all';
app.h2.InteractionsAllowed = 'none';
end
说明:
- button_3:画一条绿线
- button_4:画一条红线
- button_5:(我想让红线不能改变,绿线除外)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。