In GUI, is there a function where I can initialize variables using handles that I can then pass on to all CreateFcn items?
Mostrar comentarios más antiguos
OK, so I am new to GUI and am using the GUIDE feature. I created a complicated UI with lots of popout menus, sliders, etc. I wanted a bunch of variables to be readily accessible to the CreateFcn functions of all the items. I tried OpeningFcn but it looks like all the CreateFcn's are run before the OpeningFcn. I have the option of just declaring all my variables using handles in the popoutmenu that runs first. But is there no other alternative to this? I would ideally like a function to initialize all my required variables that runs first before creating any functions. Or at least, let me know if there is a way we can determine which menu item runs first. It looks like by default, the item you created last will run first. Thank you!
Respuesta aceptada
Más respuestas (1)
Akhilesh Thakur
el 3 de Ag. de 2017
0 votos
I guess in createFn the handles are not created. handles empty - handles not created until after all CreateFcns called So i guess you wanted to initialise all the handles before the object is made visible. Doing that in OpeningFn would be easier. And you can do that by just modifying for eg handles.keyFnpress == 'ENTER' in your function. So you can modify all the properties. I hope this helps.
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!