フィルターのクリア

Getting ginput to read axes on an appdesigner GUI

15 ビュー (過去 30 日間)
Randall Poe
Randall Poe 2022 年 7 月 1 日
コメント済み: Bruce Rodenborn 2024 年 1 月 19 日
I am trying to use ginput() on a GUI that I am building with appdesigner. The problem is that when I call ginput(), it creates a new figure window and then acts on that window, instead of on my GUI.
I've tried preceding it with a call to axes, i.e.
axes(app.ImageAxes);
[x, y] = ginput(1);
But that has the same effect, it still creates a new figure window and then puts the cross hairs on the new window.
What is the proper way to get ginput() to read from the axes in my GUI?
I just upgraded today so I am running in R2022a.

採用された回答

Benjamin Thompson
Benjamin Thompson 2022 年 7 月 1 日
編集済み: Adam Danz 2022 年 8 月 7 日
  2 件のコメント
Randall Poe
Randall Poe 2022 年 7 月 1 日
編集済み: Randall Poe 2022 年 7 月 1 日
Thank you. I just want to summarize that what appears to be the best answer (I haven't tried it yet) is the one titled "ginput is now supported in AppDesigner starting in r2020b". This was in fact the reason I upgraded from R2020a, after reading on the mathworks site that ginput was supported in later versions. So I was a little frustrated when after the update, it still didn't seem to work.
According to that answer, the key apparently is to set handle visibility. So I'm going to experiment with that.
Update: Yes, that solution worked. Also new to me was using
set(0, 'CurrentFigure', fig);
to set the focus to the desired figure.
Bruce Rodenborn
Bruce Rodenborn 2024 年 1 月 19 日
How could this work? The whole point is to keep ginput focused on a the APP and this references a MATLAB figure window.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by