Access the name of a ui in the code -- Simple question?

2 ビュー (過去 30 日間)
Douglas Anderson
Douglas Anderson 2016 年 12 月 3 日
コメント済み: Walter Roberson 2016 年 12 月 3 日
Hello!
This may be obvious, but I am writing GUIDE code for a gui, and want to access the name of the ui within the code (for a file name). Is it "handles.ui_name" or something simple like that? GUIDE puts it all through the code, prepending it to, for example, _OpeningFcn.
Thanks!
Doug Anderson

採用された回答

Image Analyst
Image Analyst 2016 年 12 月 3 日
Double click on your figure in GUIDE. Then go to the "name" property and type in some name for it. Then look at the "tag" property. Let's say you gave it a "tag" property of figMainWindow. Then to get it the name property, do this:
thisFiguresName = handles.figMainWindow.name;
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 12 月 3 日
Note: this syntax requires R2014b or later.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by