GUI Tab Panel Not Responsive

I created a GUI using GUI layout toolbox. In my code, I have something similar to:
gui = createGUI();
data = initData();
for ii = 1:data.num_trials
updateGui(gui, data);
...
data = intensiveProcessing(data);
end
For my GUI, I created a HBox with a tab panel as a child. There are three tabs (tab1, tab2, tab3). While I'm running the above code, my GUI is not responsive (presumably because of the processing that occurs inside of the intensiveProcessing function. As a result, if I want to select a different tab, the response time is pretty slow, and I have to continuosly click the tab that I want until the GUI finally responds and switches to the next tab's view. Is there a way to make the GUI more responsive? Granted, within the tabs, I plot data that is dependent on the intensive processing being completed, but I still want the ability to be able to change tabs and not have to wait until my code breaks out of the intensiveProcessing function. I tried adding a pause statement in between updateGui() and intensiveProcessing(), but that didn't solve the problem. The intensiveProcessing function takes about a minute to complete. I've even tried adding a callback for ButtonDownFcn and SelectionChangedFcn, where the function just calls the drawnow() function, but to no avail.
set(gui.tpanel, 'ButtonDownFcn', @refreshWindow);
set(gui.tpanel, 'SelectionChangedFcn', @refreshWindow);

2 个评论

Do you have drawnow() calls sprinkled in the intensiveProcessing() code ?
I do not... but I will add them and report back as soon as I can.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品

版本

R2018b

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by