Hi Priyana,
There is a slight change in syntax that you need to make for the ButtonPushedFcn.
Assuming that when Button 1 is pushed, nothing should happen, and when Button 2 is pushed, the figure should close, I corrected the syntax as follows :
function ButtonQuit
message = sprintf("Are you sure you would like to quit gesture recognition?");
figquit = uifigure('Position', [450 150 395 175]);
tarea = uitextarea(figquit);
tarea.Value = message;
%movegui('southeast')
%uialert(figquit,message,'Warning','Icon','warning');
% Create a push button %left bottom width height
btn1 = uibutton(figquit,'push',...
'Position',[25, 20, 150, 50],...
'ButtonPushedFcn', @(btn,event) Button1);
btn1.Text = 'Yes, Quit';
btn2 = uibutton(figquit,'push',...
'Position',[225, 20, 150, 50],...
'ButtonPushedFcn', @(btn,event) Button2);
btn2.Text = 'No'
function Button1(btn, event)
return;
end
function Button2(btn, event)
close(figquit);
end
end
If you need an example on how to create a quit button, have a look at the following link:
Hope this helps !
Regards,
Divija