Clicking Disabled Button Generates Error
Mostra commenti meno recenti
Hi all,
I've designed an audio experiment where a sound is presented and subjects then have to respond using a touchscreen by pressing one of three buttons. I've made it so that once a sound is played, buttons are then enabled, and once they are pressed, they are disabled. When I press the first button twice, even though it is disabled after the first press, I get the following error:
??? Error using ==> feval
Undefined function or method 'pushbutton1_ButtonDownFcn' for input
arguments of type 'struct'.
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> run_timbre_exp at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)run_timbre_exp('pushbutton1_ButtonDownFcn',hObject,eventdata,guidata(hObject))
??? Error using ==> pause
Error while evaluating uicontrol ButtonDownFcn
The weird part is that I get this error for only ONE of the buttons. Any ideas as to what is going on?
Risposta accettata
Più risposte (1)
Malcolm Lidierth
il 8 Dic 2011
0 voti
pause causes the event despatch thread to be flushed. It looks then, as though the second button click event is despatched before the button is disabled and is on the EDT. Have you tried defining a nop 'pushbutton1_ButtonDownFcn'
Categorie
Scopri di più su Entering Commands in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!