I currently have two GUIs which need to share data: a main GUI and subgui. Specifically, I need to update the handles structure of my main GUI from within the subgui.
My current method is to call the main GUI from within my subgui and then use guidata to obtain and update its handles. So, my code within one of the subgui callbacks looks something like this:
mainGuiHandle = mainGui;mainGuiData = guidata(mainGuiHandle);mainGuiData.some_data = some_data;guidata(mainGui,mainGuiData)
I managed to prevent the main GUI's opening function from running by setting an "initialized" flag to be stored in the handles structure. However, the main GUI is still "brought to front" whenever it is called. I've partially counteracted this by using the uistack function. There still remains a brief flickering, however, which is a bit of an annoyance. My question then, is how to prevent this, and whether it can be done using my current method or if it requires another strategy. I suspect I need to go about this differently, as the current method is fairly crude.
Apologies this question has already been asked or if the answer is readily available in Matlab documentation–I did a bit of snooping around but was unable to find anything relevant to my situation.
Note: after looking around a bit, I chose this method because I have little experience with having two GUIs "interact" and it seemed both the simplest and most intuitive. I looked into other methods such as using setappdata, but decided against them. It may very well be that, for what I'm wanting to accomplish, this method isn't ideal, so I'm open to "starting fresh". You'll likely just have to endure some painfully basic questions. ^_^
Best Answer