addlistener does not always trigger on the event when minimizing a figure.

3 次查看(过去 30 天)
I am trying to add a listener to detect when my main figure has be minimized so I can minimize other figures also. Sometime it works and at times it doesn't.
Here is a snippet of code I have used:
jFrame = get(handle(gcf),'JavaFrame'); fr = jFrame.fHG1Client.getContentPane.getTopLevelAncestor(); addlistener(fr,'Minimized',@(o,e)myminimized_callback(o,e));
function myminimized_callback(o,e) disp('figure has been minimized');
Sometimes it works but not consistently. Can someone tell me what I am doing wrong and give me a snippet of code to try.
Thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by