|
|
|
|
|
Re: When to save DialogSettings? [message #436218 is a reply to message #436216] |
Thu, 13 May 2004 13:05 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
This should work for you, the following snippet works for me on win32 and
gtk. If you have a proper case that fails then please log a bug report with
Platform - SWT and include the snippet that shows the failure happening.
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10,10,220,100);
final Table table = new Table(shell, SWT.NONE);
table.setLinesVisible(true);
table.setBounds(10,10,200,50);
new TableColumn(table, SWT.NONE).setWidth(100);
new TableColumn(table, SWT.NONE).setWidth(100);
shell.addShellListener(new ShellAdapter() {
public void shellClosed(ShellEvent e) {
System.out.println("column count: " +
table.getColumnCount());
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
Grant
"Ole Laurisch" <OIe.Laurisch@NOSPAMt-systems.com> wrote in message
news:c7vmfe$e4i$1@eclipse.org...
> Hello Grant,
>
> "Grant Gayed" <grant_gayed@ca.ibm.com> schrieb:
>
> > The shellClosed callback will allow you to do this, like:
> >
> > shell.addShellListener(new ShellAdapter() {
> > public void shellClosed(ShellEvent e) {
> > // shell about to be disposed, so save settings here
> > }
> > });
>
> Thank you for your quick response! I've tested your code, but then I get
> this Exception,
> "org.eclipse.swt.SWTException: Widget is disposed"
> while I try to read out the settings of a table with this statement:
> "table.getColumnCount()".
>
> The table seems to be already disposed. So the shellClosed-Event seems to
be
> to late.
>
> Is there any summary about the different events and their order in the
> runtime of a swt-programm?
>
> Any hint would be appreciated!
>
> Ole
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03270 seconds