On Saturday 21 April 2007 17:38, Mathias Bauer wrote:
Hi Mathias,
> So you are talking about the "Close" entry in the menu...
Exactly! Sorry, if i described my problem not closely enough.
> Are you sure that your users will want this?
I hope they will like it, if it works in that way i want it to do. Because if
many documents are opened and the File-Exit menu is disabled nobody can
accidentally close all documents at one time (and therefore it isn't
necessary to reopen the unmeant closed docs). That's what i want. Closing a
doc shall be possible only via the File-Close menu.
> I don't understand why the Desktop.terminate() doesn't work for you.
I think the problem was that i have some observers which are registered as
window listeners? These seems to cause problems for the AWT event dispatching
thread. The following seems to work :
public void windowClosed() {
...
if (docCount == 0) {
logger.debug("docCount == 0 -> terminate the
application");
SwingUtilities.invokeLater(new Runnable() {
public void run()
removeWindowListeners();
boolean terminated =
xDesktop.terminate();
}
});
}
}
> OOo 1.0 did exactly what you want: shut down OOo when the last
> document is closed. If you are interested I can look
> up the configuration setting you have to set.
That would be an interesting alternative! Would be very nice, if you look up.
Greets,
Reinhold
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]