Listdlg freezes but not when debugged; using pause seems to fix
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am using matlab R2012B, and using listdlg to allow the user to select which channels need to be processed:
[s,v] = listdlg('PromptString', 'Select Channels to Display',...
'SelectionMode', 'multiple', 'Name','Channel Selection',...
'ListString', handles.DAQ_info.Ch_Names, 'InitialValue', handles.channels);
Sometimes the dialog box would freeze and other times it would work fine. Everytime I would place a debug at or after it there wouldn't be a problem. As a work around I placed a pause(1/4) after it and everything seems to work fine now. Just wondered if anyone has had this issue or knows why this is occuring.
Thanks
Brad
0 Commenti
Risposte (1)
Sean de Wolski
il 2 Gen 2013
Modificato: Sean de Wolski
il 2 Gen 2013
This is expected. One of the features of pause() is that it flushes the event queue so any pending events are taken care of before the code continues. This is the sole purpose of drawnow() so I recommend using drawnow() instead.
The reason it is hanging is because all of the events build up. Matt and I discussed this here: Old Answer
0 Commenti
Vedere anche
Categorie
Scopri di più su Startup and Shutdown in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!