Info

This question is closed. Reopen it to edit or answer.

Context menus didn't show where it should be.

1 view (last 30 days)
QiQin Zhan
QiQin Zhan on 8 Mar 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
I use a ButtonDownFcn of axes1 to generate a context.However,all seems to be right except that the context doesn't show where the mouse click on.In fact,it always shows on the left buttom of the figure no matter where I click on the axes.The figure‘s units is set to normalized.
function axes1_ButtonDownFcn(hObject, eventdata, handles)
if strcmp(get(gcf,'SelectionType'),'alt') % Right click the mouse
pos=get(gcf,'CurrentPoint');
set(handles.Context_Menus,'position',[pos(1,1),pos(1,2)],'visible','on')
end

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!