how can I disable the window top-right button to close application?
Thanks a lot
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think you can disable it (like make it gray) since it is managed by the underlying OS window manager, not by SWT directly.
You can add a listener though, in order to ignore any close event, a bit like in this snippet:
In your case, simply set ‘
event.doit‘ tofalse.