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 Kommentare

Walter Roberson
Walter Roberson am 3 Okt. 2019
Do you have drawnow() calls sprinkled in the intensiveProcessing() code ?
Ivan Aguilar
Ivan Aguilar am 3 Okt. 2019
I do not... but I will add them and report back as soon as I can.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2018b

Tags

Gefragt:

am 3 Okt. 2019

Kommentiert:

am 3 Okt. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by