How to call pushbutton callback again in uicontrol

1 visualización (últimos 30 días)
amir nemat
amir nemat el 2 de Sept. de 2017
Comentada: Image Analyst el 4 de Sept. de 2017
I want to use pushbutton2_callback again in my code like following
h_record=uicontrol('style','pushbutton', 'pos', [730,30,25,25], 'Callback', @pushbutton2_Callback);
but it gives me an error
Error using tpac6de6f0_2275_443d_a558_3c8bef237e41>pushbutton2_Callback (line 1056) Not enough input arguments.
Error while evaluating uicontrol Callback
  1 comentario
Image Analyst
Image Analyst el 4 de Sept. de 2017
Why not just create the control in GUIDE rather than dynamically with a line of MATLAB code? Then you don't have the problem.

Iniciar sesión para comentar.

Respuestas (1)

Joost
Joost el 2 de Sept. de 2017
Uicontrol callbacks have two default input arguments. Please have a look at the example on the following help page: https://nl.mathworks.com/help/matlab/creating_guis/write-callbacks-using-the-programmatic-workflow.html
  2 comentarios
amir nemat
amir nemat el 2 de Sept. de 2017
Thanks for your respond. I have tested them but none of them are working for me my pushbutton is pushbutton2_Callback(hObject, eventdata, handles)
and I use Matalb 2014a version
amir nemat
amir nemat el 4 de Sept. de 2017
Thanks for your respond. I have tested them but none of them are working for me my pushbutton is pushbutton2_Callback(hObject, eventdata, handles)
and I use Matalb 2014a version

Iniciar sesión para comentar.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by