Skip to content

Commit 64b81ab

Browse files
author
jaib1
committed
bug fix for uicontextmenu in Condition and Field Panels
1 parent 7259eef commit 64b81ab

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

+eui/ConditionPanel.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@
4343
% See also EUI.PARAMEDITOR, EUI.FIELDPANEL
4444
obj.ParamEditor = ParamEditor;
4545
obj.UIPanel = uix.VBox('Parent', f);
46-
% Create a child menu for the uiContextMenus
47-
c = uicontextmenu;
46+
% Create a child menu for the uiContextMenus. The input arg is the
47+
% figure holding the panel
48+
c = uicontextmenu(ancestor(f, 'Figure'));
4849
obj.UIPanel.UIContextMenu = c;
4950
obj.ContextMenus = uimenu(c, 'Label', 'Make Global', ...
5051
'MenuSelectedFcn', @(~,~)obj.makeGlobal, 'Enable', 'off');

+eui/FieldPanel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
% See also ONEDIT, EXP.PARAMETERS/TITLE, EUI.PARAMEDITOR/BUILDUI
6262
if nargin < 3; type = 'edit'; end
6363
if isempty(obj.ContextMenu)
64-
obj.ContextMenu = uicontextmenu;
64+
obj.ContextMenu = uicontextmenu(ancestor(obj.UIPanel, 'Figure'));
6565
uimenu(obj.ContextMenu, 'Label', 'Make Conditional', ...
6666
'MenuSelectedFcn', @(~,~)obj.makeConditional);
6767
end

0 commit comments

Comments
 (0)