Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Pocket PC Closing shell
Pocket PC Closing shell [message #456357] Wed, 01 June 2005 09:30 Go to next message
Eclipse UserFriend
Originally posted by: bogdan.nowhere.com.pl

I'd like to show confirm dialog when user tries to close window,
I add ShellListener to my main window,
and in shellClosed method I try to display dialog,

but every time I close shell with close button (shell is created with
SWT.CLOSE style) application is closing without displaying dialog.

when I close shell from within the application, calling
shell.close(),
all works well, I can see confirm dialog and deny closing window,

How to make it work with close button display in shell title bar?

I'm using Pocket PC 2003 and SWT 3135
Re: Pocket PC Closing shell [message #456369 is a reply to message #456357] Wed, 01 June 2005 15:35 Go to previous messageGo to next message
Felipe Heidrich is currently offline Felipe HeidrichFriend
Messages: 29
Registered: July 2009
Junior Member
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
Re: Pocket PC Closing shell [message #456626 is a reply to message #456369] Mon, 06 June 2005 07:03 Go to previous message
Eclipse UserFriend
Originally posted by: bogdan.nowhere.com.pl

It doesn't work for me.
When I close app from title bar,
app is closing suddenly just as like j9 console.
I can't see any question.
I can't event check if was there some exception or sth.

I'm using HP iPAQ rx3715,
PocketPC 2003, version 4.21.1088
swt 3135

Have someone similar problems?
How can it be fixed?

pozdr.
bogdan
Previous Topic:How to make excutable jar?
Next Topic:Problem with a blocking thread
Goto Forum:
  


Current Time: Thu Apr 25 11:03:52 GMT 2024

Powered by FUDForum. Page generated in 0.03091 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top