MATLAB: UIContextMenus for toggle buttons

MATLABuicontextmenu uimenu uitoggletool

Greetings Matlabers
Is is possible to at uicontext menus to toggle buttons. When I assign a context menu to my button it does not show up when the object is right clicked over. However, I can assign the same context menus to other objects (lines for example) and it shows up. This leads me to think that my problem is not with the context menu but with the toggle button or how it is assigned.
Has anyone experienced/worked with this before?
The toggle button works as expected before the uicontext menu is assigned. It continues to work after with an exception of the context menu I just assigned.
Thanks in advance for any help
dcmenu = uicontextmenu;
dcitem(1) = uimenu(dcmenu, 'Label', 'X', 'Checked', 'on');
dcitem(2) = uimenu(dcmenu, 'Label', 'Y', 'Checked', 'on');
dcitem(3) = uimenu(dcmenu, 'Label', '1/X', 'Checked', 'off');
dcitem(4) = uimenu(dcmenu, 'Label', '1/Y', 'Checked', 'off');
dcitem(5) = uimenu(dcmenu, 'Label', 'X/Y', 'Checked', 'off');
hToolbar = uitoolbar();
hS.legend = uipushtool('Parent', hToolbar, ...
'CData', createCData('legend'),...
'ClickedCallback',@legend_hideFcn,...
'TooltipString', 'Toggle Legend');

Best Answer

Nope; the uipushtool ignores the 'UIContextMenu' property.