Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Report generator from a GUI
Date: Tue, 21 Oct 2008 14:03:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 71
Message-ID: <gdknen$33e$1@fred.mathworks.com>
References: <gdil46$a66$1@fred.mathworks.com> <gdkgdm$7hu$1@fred.mathworks.com> <gdkm3n$fds$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1224597783 3182 172.30.248.37 (21 Oct 2008 14:03:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Oct 2008 14:03:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1118512
Xref: news.mathworks.com comp.soft-sys.matlab:496533


Yes, Steven is right,I also had tried changing the CloseRequestFcn, hoping for something as close all was in the code, but my GUI disappeared so I think there is a delete all or something like that. 

Does somebody know which function in the report generator blockset is the one in charge of close all the figures? Maybe if the code is open I will be able to change it.

Now, I'm working with the debugger searching for it.


"Steven Lord" <slord@mathworks.com> wrote in message <gdkm3n$fds$1@fred.mathworks.com>...
> 
> "Ben " <basburywvu.nospam@hotmail.com> wrote in message 
> news:gdkgdm$7hu$1@fred.mathworks.com...
> > "Sonsoles Romero Garc?a" <krokketilla@gmail.com> wrote in message 
> > <gdil46$a66$1@fred.mathworks.com>...
> >> I'm using the report generator to generate a automatic report for a tool. 
> >> I want to launch the report from a GUI, my problem is that once the 
> >> report is generated, my GUI is closed and deleted (the report generator 
> >> functionality deletes all the figures opened by Matlab).
> >>
> >> Does anybody know how can I keep my GUI opened and get the report 
> >> generated?
> >>
> >> I've tried saving the figure but it doesn't work (the GUI has Java 
> >> objects and I lose them, and by loading again all the handles are 
> >> "renamed" and the GUI is not working any more)
> >
> > I had the same thing happen to one of my GUIs and here was my work around.
> >
> > I cleared out the CloseRequestFcn for the main figure of the GUI by 
> > setting it equal to empty string.  (I think I did it in the opening 
> > function).
> >
> > set(handle.MainGUI,'CloseRequestFcn','')
> >
> > This will prevent anything from closing it.  Event the "X" close button on 
> > the figure. Also it will be impossible to use delete() or close().
> 
> You're half right.  CLOSE will not close a figure whose CloseRequestFcn is 
> set to the empty string (or to something that doesn't call DELETE on the 
> figure handle.)  DELETE will.
> 
> 
> >> h = figure('CloseRequestFcn', 'disp(''I refuse to be closed'')');
> >> close(h)
> I refuse to be closed
> >> close(h)
> I refuse to be closed
> >> % click on the X
> I refuse to be closed
> >> delete(h)
> 
> and the figure is gone.
> 
> 
> >  So to actually close the GUI when I really wanted to I added a "Close 
> > Button" on my GUI (just a pushbutton).  Make the new Close button's 
> > callback to be as follows:
> >
> > set(handle.MainGUI,'CloseRequestFcn','closereq')
> > close(handle.MainGUI)
> 
> Or you could have the Close button's callback be:
> 
> 
> delete(gcbf)
> 
> 
> -- 
> Steve Lord
> slord@mathworks.com 
>