Why am I unable to set the "UIContextMenu" property of my uicontrol back to "None" using the Property Inspector in MATLAB 6.5 (R13)?
3 次查看(过去 30 天)
显示 更早的评论
For example, if I set the "UIContextMenu" property of my pushbutton to some context menu I created using the Menu Editor in GUIDE, and then try going back to "None", I receive the following error in the MATLAB Command Window:
"Exception while setting the value"
The "UIContextMenu" property value in the Property Inspector remains the same.
采纳的回答
MathWorks Support Team
2009-6-27
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This is a bug in MATLAB 6.5 (R13) in the way that GUIDE handles setting property values using Property Inspector. Our development staff is investigating this issue.
Currently, to work around this issue, try setting the "UIContextMenu" property of your uicontrol to [] in the "OpeningFcn". For example:
function test_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
set(handles.pushbutton1,'UIContextMenu',[])
guidata(hObject, handles);
Alternatively, you can also use the following workaround:
1. Create a new context menu in the Menu Editor.
2. From the Property Inspector, set the "UIContextMenu" property to the new context menu.
3. In the Menu Editor, delete the new context menu by highlighting it and then clicking on the trash can icon.
4. In the Property Inspector, you will see the "UIContextMenu" has been reset to "None".
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!