How do I stop MATLAB from changing the focus to a random window after closing a dialog?
4 views (last 30 days)
Show older comments
Hi,
when I create a simple dialog like:
dialog('name','My Dialog');
and then close it using the "X" an arbitrary other window (not another MATLAB figure, just a random program like outlook) gets the focus.
strange :-S
Any ideas?
Greetings
Jeffrey
0 Comments
Accepted Answer
Sean de Wolski
on 14 Aug 2012
Hmmm. This seems to happen if the 'WindowStyle' is 'Modal':
figure('windowstyle','modal')
Apparently setting the CloseRequestFcn to delete(src) fixes it:
figure('windowstyle','modal','closerequestfcn',@(src,evt)delete(src))
0 Comments
See Also
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!