Copying a GUIDE interface and retaining the tag names

1 回表示 (過去 30 日間)
Matt
Matt 2018 年 1 月 24 日
コメント済み: Matt 2018 年 2 月 9 日
Hi all,
I am updating a large program I wrote a while back that uses 14 separate interlinked GUIDE interface windows. I am creating a tabbed version instead using TabManager on the File Exchange.
Is there a way to copy the components from one GUIDE GUI to another and retain the tag names?
By default they are renamed when I copy them into my new interface. If I could avoid this it would save me a couple of days work re-naming hundreds of static text and edit text fields, buttons etc. I could then copy the code from my old callbacks to my new callbacks and know everything will still work as it did.
I think the answer to this is "no"...?
Thanks,
Matt

採用された回答

Walter Roberson
Walter Roberson 2018 年 2 月 8 日
編集済み: Walter Roberson 2018 年 2 月 8 日
"Is there a way to copy the components from one GUIDE GUI to another and retain the tag names?"
openfig() the .fig file associated with the GUI. copyobj() the appropriate parts of the returned figure into the figure that is going to be the merged result.
Note that the callbacks that GUIDE generates internally all reference the original GUI name, such as
@(src, event) OriginalGUI('openFiles_KeyPressFcn', src, event, guidata(src) )
and those properties are going to remain the same when you copyobj(), leaving you with references to multiple functions. copyobj() will not adjust the saved callback properties for you.
  1 件のコメント
Matt
Matt 2018 年 2 月 9 日
Very interesting approach - I didn't know you could do that. I will try your method.
I've done it all manually now, and that was OK as it forced me to re-tag everything better than it originally was, and in a more structured way - which it had to be as there are 14 very full tabs now!

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

その他の回答 (1 件)

bon sai
bon sai 2018 年 1 月 25 日
try 'Save as..', I think
  1 件のコメント
Matt
Matt 2018 年 2 月 8 日
Thanks, but I was trying to copy the components on several GUIs onto a new larger tabbed GUI. The only way was to copy them across and lose the tags, but it forced me to re-tag everything better than it originally was, and in a more structured way - which it had to be as there are 14 very full tabs now!

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

カテゴリ

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