Re: How to create a window that cannot be closed by clicking on the X button
Andrea Gavana <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <CAEf70bwVPT68fK2+ygXXhdy4zOm=Q33Kz=9k8vdQPRAUSOsixQ@mail.gmail.com> |
On Fri, 17 Jul 2020 at 18.59, James Stallings II <[email protected]> wrote: > There are obviously philosophical discussions to be had around the wisdom > of removing window controls, but I will leave those to others and answer > your question most directly. > > This is accomplished with the proper value passed for the frame style > parameter when you create the frame. > > The value to be passed is wx.STAY_ON_TOP. > > see https://wxpython.org/Phoenix/docs/html/wx.Frame.html > > Best of luck ;) > wx.STAY_ON_TOP will not prevent the user to close a frame, it will simply put that frame on top of the other windows in the app. While I agree that it’s not a particularly user-friendly design, using EnableCloseButton(False) on the log frame is possibly the easiest way to do what the OP asked. Andrea. > On Fri, Jul 17, 2020 at 11:53 AM Tim Roberts <[email protected]> wrote: > >> Matthias Brennwald wrote: >> >> >> I am trying to create a window/frame that cannot be closed by clicking on >> the X button. The purpose of the window is to show log messages or warnings >> coming from various parts of the program. >> >> It seems to me that this is a matter for user education. If they want to >> hide the window, let them hide the window. Maybe I don't want to have the >> log messages cluttering up my desktop. Have a menu item that shows the >> dialog again, and if some critical warning comes up, show it automatically, >> but there's no good reason to make in uncloseable.. >> >> Unhideable windows and unkillable applications will always come back to >> bite you eventually. >> >> -- >> Tim Roberts, [email protected] >> Providenza & Boekelheide, Inc. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "wxPython-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/wxpython-users/264a3be9-aa04-5a9c-e8e6-6c3d9331001b%40probo.com >> <https://groups.google.com/d/msgid/wxpython-users/264a3be9-aa04-5a9c-e8e6-6c3d9331001b%40probo.com?utm_medium=email&utm_source=footer> >> . > > >> -- > ॐ♲ ♥ ☸☮ ☯☰☶☯☮ ☸ ♥ ♲ॐ > > -- > You received this message because you are subscribed to the Google Groups > "wxPython-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/wxpython-users/CAOaG_2Y%3DS6JtLrFif7epKxyYBH43uLnB9BCv4o50WYUEHRVxsA%40mail.gmail.com > <https://groups.google.com/d/msgid/wxpython-users/CAOaG_2Y%3DS6JtLrFif7epKxyYBH43uLnB9BCv4o50WYUEHRVxsA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "wxPython-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CAEf70bwVPT68fK2%2BygXXhdy4zOm%3DQ33Kz%3D9k8vdQPRAUSOsixQ%40mail.gmail.com.