Setting the figure "Tag" property for a waitbar

17 ビュー (過去 30 日間)
owr
owr 2013 年 2 月 20 日
Hi folks,
Hoping one of you has an easy solution for me. Skipping over the non-relevant details, Im trying to add a tag to a waitbar so that multiple functions can re-use the same waitbar figure. Normally I would just capture and share the handle directly, but each function is deployed as a method in a .NET dll and I have no control over how the end user will use these from C#
Specifically, why cant I used the 'Tag' property and "findobj" like I can with normal figure windows?
>> waitbar(0.2,'Message','Tag','MyWB')
>> h = findobj('Tag','MyWB')
h =
Empty matrix: 0-by-1
Im trying to mimic the 'replace' option that I can use with "warndlg"
If this turns out ot be impossible/too difficult, I have another plan that will use the waitbar handle directly and getmcruserdata/setmcruserdata.
Thanks!

採用された回答

Jan
Jan 2013 年 2 月 20 日
編集済み: Jan 2013 年 2 月 20 日
The waitbar has a hidden handle. Therefore you need findall or allchild:
waitbar(0.2, 'Message', 'Tag', 'MyWB');
h = findall(0, 'Tag', 'MyWB')
When there are a lot of graphic objects, this can be remarkably faster, because it searches the figures only:
h = findobj(allchild(0), 'flat', 'Tag', 'MyWB')
  1 件のコメント
owr
owr 2013 年 2 月 26 日
Excellent Jan, this works perfectly. My apologies for not addressing this earlier. I got involved with other projects and had forgotten that I had posted this.
Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by