Set class method as CloseRequestFcn
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Performance and Memory dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!