Path: news.mathworks.com!not-for-mail
From: "Ben " <basburywvu.nospam@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Report generator from a GUI
Date: Tue, 21 Oct 2008 12:03:02 +0000 (UTC)
Organization: Orbital Sciences Corp
Lines: 22
Message-ID: <gdkgdm$7hu$1@fred.mathworks.com>
References: <gdil46$a66$1@fred.mathworks.com>
Reply-To: "Ben " <basburywvu.nospam@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1224590582 7742 172.30.248.35 (21 Oct 2008 12:03:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Oct 2008 12:03:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 425457
Xref: news.mathworks.com comp.soft-sys.matlab:496506


"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(). 

  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)


Hope that helps