Two Window Apps dispose question [message #153939] |
Wed, 24 May 2006 21:12 |
Eclipse User |
|
|
|
Originally posted by: nnikonova.yahoo.com
Hi,
I am working on an IDE type application. I have added a custom main menu
option to our workbench and when the user selects this option a new window
("Host Manager" window) needs to open up. The IDE window extends
ApplicationWindow. The "Host Manager" window currently also extends
ApplicationWindow class. Here are my questions:
1. Does the main IDE window needs to be a parent of the "Host Manager"
window? If yes, then why?
2. When I close the Host Manager window, the application crashes with the
following exception:
Widget is disposed
Unhandled event loop exception
Here is a snippet of code I have in the HostManager's run method:
public void run()
{
// don't return from open() until window is closed
setBlockOnOpen(true);
// open the main window
open();
// dispose the display
Display.getCurrent().dispose();
}
I think there is a problem with calling Display.getCurrent().dispose()
from the "Host Manager" window. However, if I completely omit this line
of code, I am not sure if all the necessary cleanup is being performed.
What's the best way to handle the cleanup of the shell and the widgets
that are part of the shell without deleting the Display?
Thanks,
Natalia
|
|
|
Powered by
FUDForum. Page generated in 0.03005 seconds