How do I capture the onCloseEvent for the X? [message #452162] |
Mon, 14 March 2005 20:07 |
Eclipse User |
|
|
|
Originally posted by: mishi_math.yahoo.com
In my shells i have exit buttons that I can handle without a problem. But
in the case of having the X in the upper right hand corner and controling
that I am stumped. I found the window "protected boolean
canHandleShellCloseEvent()" method, but not even sure how this would be
implemented and if it is even the right thing...
This is what I am looking to do, if someone has 'dirtied' the form but
they haven't saved their changes and they use the window close X button, I
want to pop up a dialog window reminding them that they haven't saved
their work and giving them the option to save or just exit.
Could someone help me please?
Regards,
Mishi
|
|
|
Re: How do I capture the onCloseEvent for the X? [message #452163 is a reply to message #452162] |
Mon, 14 March 2005 20:26 |
Eclipse User |
|
|
|
Originally posted by: bob.objfac.com
How about setting a ShellListener? When you get a shellClose() do your
dirty test and dialog. If the user cancels, set the doit flag in the
event to false.
Bob Foster
Mishi wrote:
> In my shells i have exit buttons that I can handle without a problem.
> But in the case of having the X in the upper right hand corner and
> controling that I am stumped. I found the window "protected boolean
> canHandleShellCloseEvent()" method, but not even sure how this would be
> implemented and if it is even the right thing...
>
> This is what I am looking to do, if someone has 'dirtied' the form but
> they haven't saved their changes and they use the window close X button,
> I want to pop up a dialog window reminding them that they haven't saved
> their work and giving them the option to save or just exit.
>
> Could someone help me please?
>
> Regards,
> Mishi
>
|
|
|
Powered by
FUDForum. Page generated in 0.03018 seconds