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!