Clear Filters
Clear Filters

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

3 views (last 30 days)
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

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!