Set class method as CloseRequestFcn
显示 更早的评论
I am currently working on a waitbar that is implemented as a class. I need to detect when the user clicks the X-button of the window to cancel computations and then set a flag.
Considering the following class:
classdef myWaitbar < handle
properties
figHandle
cancel
end
methods
function obj = myWaitbar()
obj.cancel = false;
obj.figHandle = figure('CloseRequestFcn', @...);
end
function setFlag(obj)
obj.cancel = true;
end
end
end
Does anybody know how to declare CloseRequestFcn and setFlag to make this work? I tried a few different approaches but could not find a proper way.
Thank you
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Performance and Memory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!