appdesigner context menu opening in the wrong position

I have been working on an app mostly in R2022a. After updating to R2022b I noticed a context menu for a UIAxes is now opening far away from the click point. I'm not sure if the update broke it or what. I tried to find a way to set the position of the context menu, or make my own menu, but I didn't have luck. Does anyone have a fix for this? Thanks
I tried adding a brand new UIAxes to the app and adding a brand new contextmenu to it. The same bad behavior resulted. If I make a new app, everything is fine.

2 件のコメント

Cameron
Cameron 2022 年 12 月 22 日
I'm using R2022b and haven't found any issues. What does your code look like for your ContextMenu? I'll show you what I was using when I didn't get any errors when right clicking for the ContextMenu.
cm = uicontextmenu(app.UIFigure);
m1 = uimenu(cm,"Text","Option 1");
m2 = uimenu(cm,"Text","Option 2");
app.UIAxes.ContextMenu = cm;
sigguy90
sigguy90 2022 年 12 月 22 日
編集済み: sigguy90 2022 年 12 月 22 日
I used the appdesigner GUI to create it, so all the code for it was automatically created and locked. The context menu appears at the same x position but down the screen in y.
I made a brand new app to test, and it works correctly in that. So it's like my real app got 'corrupted'.
This results when I right click close to the top of the UIAxes:

サインインしてコメントする。

 採用された回答

sigguy90
sigguy90 2023 年 1 月 4 日

2 投票

This issue was caused by a component being located outside the app uifigure boundaries. If all components are inside, the context menu works as expected.

1 件のコメント

podono
podono 2023 年 1 月 17 日
Thank you for the update! This solved my issue of the context menu not appearing (probably appearing out of bounds).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

リリース

R2022b

タグ

質問済み:

2022 年 12 月 21 日

コメント済み:

2023 年 1 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by