RE: How to create a window that cannot be closed by clicking on the X button

Steve Barnes <[email protected]>
Newsgroups gmane.comp.python.wxpython
Message-ID <DB7PR03MB4475BABF588CDC75613AF3479B7D0@DB7PR03MB4475.eurprd03.prod.outlook.com>
Of course you could always change your event handler to have it display a message explaining why the user is not allowed to close this window. However, unless this is for something like a kiosk application I personally would rather have a dialog that explains to the user why I think it is not a good idea to close the window and gives them the option to do so or not. Personally, when I find applications that behave in a too authoritarian manner, e.g. showing me a log window that I can’t get rid of or constantly opening new windows for everything, I try to find alternatives to use or use them as rarely as possible.

Steve Barnes

From: [email protected] <[email protected]> On Behalf Of Matthias Brennwald
Sent: 17 July 2020 17:34
To: wxpython-users <[email protected]>
Subject: [wxPython-users] How to create a window that cannot be closed by clicking on the X button

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.

At first, I tried to remove the X button, but I couldn't make it work (I tried this: https://stackoverflow.com/questions/25024129/wxpython-how-to-hide-the-x-and-expand-button-on-window ). For now, I just made an event handler that essentially discards the "clicked on the X button" event. While this achieves what I need, it is confusing to the user ("Why is there an X button, if it does nothing!?")

Is there a better, cleaner, nicer way to prevent users from closing a window?
--
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]<mailto:[email protected]>.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/8OGMDQ.2FGODPWS7BYX%40gmail.com<https://groups.google.com/d/msgid/wxpython-users/8OGMDQ.2FGODPWS7BYX%40gmail.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/DB7PR03MB4475BABF588CDC75613AF3479B7D0%40DB7PR03MB4475.eurprd03.prod.outlook.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.