Thread Subject: Closing GUI windows

Subject: Closing GUI windows

From: Francis Burton

Date: 9 Nov, 2009 16:01:09

Message: 1 of 2

I'd like to make sure all GUI windows are closed when I close
the main GUI window. Unfortunately, if I call

delete(sub_gui)

when the sub_gui window isn't open, it briefly becomes visible
before disappearing again. I tried to find a way to tell if it
is open so that I don't delete it unless it is, but any reference
to sub_gui, as in ~isempty(sub_gui), causes the flickering effect.

What is the approved way of ensuring that all secondary figures
are closed when the main window is closed?

Cheers,
Francis

Subject: Closing GUI windows

From: fburton@nyx.net (Francis Burton)

Date: 9 Nov, 2009 16:38:18

Message: 2 of 2

In article <1257782468.922404@irys.nyx.net>,
Francis Burton <fburton@nyx.net> wrote:
>I'd like to make sure all GUI windows are closed when I close
>the main GUI window. Unfortunately, if I call
>
>delete(sub_gui)
>
>when the sub_gui window isn't open, it briefly becomes visible
>before disappearing again. I tried to find a way to tell if it
>is open so that I don't delete it unless it is, but any reference
>to sub_gui, as in ~isempty(sub_gui), causes the flickering effect.
>
>What is the approved way of ensuring that all secondary figures
>are closed when the main window is closed?

I found

delete(0,get(0,'Children'))

and

close all

The latter is preferable for me, because it executes the figures'
CloseRequestFcn, which I use to save the windows' positions on
screen in an .INI file (using Iroln's excellent IniConfig object).

Francis

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com