[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform.swt] Re: Pocket PC Closing shell
|
This works for me:
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display, SWT.CLOSE);
shell.setText("My App");
shell.addListener(SWT.Close, new Listener () {
public void handleEvent(Event event) {
MessageBox mb = new MessageBox(shell, SWT.YES|SWT.NO);
mb.setText("Question?");
mb.setMessage("close, are you sure?");
event.doit = mb.open() == SWT.YES;
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
Does it work for you ?
I'm not sure what is happening to you, maybe you can modify the snippet
above and send it back to me so I can test it on my machine.
Regards,
Felipe