GUIDE custom CloseRequestFcn receives empty handles
显示 更早的评论
Good Day I tried now for mutliple hours to resolve the following issue:
I want to call a custom function when the user clicks on the 'x' button on the top right corner of the window (tries to close the window).
I have a cancel button which should do the same thing, and it works without a problem. But if i try to overrite the CloseRequestFcn in the following way:
set(handles.figure1,'CloseRequestFcn',{@my_CloseRequest, handles});
which I put in the xxx_OpeningFcn, i have the problem, that the passed handles are empty. My custom close function looks like this:
function my_CloseRequest(hObject, eventdata, handles)
xxx_OutputFcn(hObject, eventdata, data);
What am i missing? why does it work with my cancel button but not with the custom my_CloseRequest? Why are the handles deleted or not accessible? Is there any workaround?
I am using a mac, could this have anything to do with it?
Thank you for any help
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!