How to Call Context Menu from Inside a Rectangle?

3 ビュー (過去 30 日間)
Rightia Rollmann
Rightia Rollmann 2017 年 2 月 26 日
回答済み: Greg 2017 年 2 月 26 日
To call the context menu, I have to right-click exactly on the outline of the circle. Is there any way to call the rectangle where ever inside it? I want it so, because it is more convenient.
hfig = figure;
hax = axes('XLim', [0 3], 'YLim', [0 3]);
c = uicontextmenu;
hr = rectangle('Position',[ 1 1 1 1],...
'Curvature', 1,...
'Parent', hax,...
'UIContextMenu', c);
m1 = uimenu(c);

採用された回答

Greg
Greg 2017 年 2 月 26 日
If you set the FaceColor of the rectangle, the uicontext menu works anywhere inside. Be aware that this may complicate other things you're trying to do.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by