Programatically add OpeningFcn in GUI
古いコメントを表示
Hi,
I have programatically created a GUI app using a single function file (e.g. mygui.m) and putting all my code in that single file. Now I need to add an OpeningFcn in that code. Where and how should I add that OpeningFcn in my code so that I can add data in handles variable in that OpeningFcn to access it later in my other functions?
Thanks
4 件のコメント
Kevin Chng
2018 年 10 月 23 日
What does it mean?
programatically created a GUI app
Are you use GUIDE, app designer or programmically GUI?
if programically GUI, it is quite flexible, you may insert a function after you declare all the relevant components. The function can be your OpeningFcn.
Haider Ali
2018 年 10 月 23 日
編集済み: Haider Ali
2018 年 10 月 23 日
Kevin Chng
2018 年 10 月 24 日
編集済み: Kevin Chng
2018 年 10 月 24 日
Using handles to pass data is what we favour to do in GUIDE Gui.
I guess it should be also workable in programmically GUI. There is some knowledge require to structure the object and handle in your GUI like what we will see in GUIDE Gui (Guide generate it automatically).
Hence, I will recommend you use global to pass your data.
Walter Roberson
2018 年 10 月 24 日
Don't use global!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!