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!