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

Charles McKnight <[email protected]>
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
My dander isn't up. I've been writing code for nearly 50 years across far 
too many languages and OSes (yes, we are likely contemporaries) to get my 
dander up over something like that. However, I do mentor a lot of teenagers 
and adults and I've found that it's important to explain the rational 
and/or reason behind what I'm telling them so that they will understand why 
they should or should not do something. That's what I was pointing out 
because without explaining why most folks will write off the comment as BS 
and I'm sure that you did not mean it to be lightly written off.

With regard to my question about it being misleading, I can see where just 
skipping the event might be confusing, but misleading is a bit strong. In 
any case, thank you for the additional post that explains the "why".

On Saturday, July 18, 2020 at 2:21:55 AM UTC-7, dangol James wrote:
>
> Hi Charles,
>
> Not my authority I was speaking with, but that of some old GUI book I read 
> many years ago, probably some style guide in the Motif Programmer’s 
> Reference.
>
> Basically it’s considered bad form to provide inoperable controls unless 
> they can be ‘greyed out’. It leads the user to believe she can do something 
> that she can’t.
>
> wxWindows is particularly powerful, and there’s probably a way to show the 
> window controls greyed out, but its not directly accessible as a wx.STYLE 
> that I’ve seen.
>
> In any case, didn’t mean to get your dander up, just relating what I’ve 
> learned in 45 years or so of programming.
>
>
> On Fri, Jul 17, 2020 at 10:44 PM Charles McKnight <[email protected] 
> <javascript:>> wrote:
>
>> Not to be blunt, but you made a pretty authoritarian statement without 
>> providing any reason or rationale.
>>
>> Why would it be misleading and who would it be misleading?
>>
>> Why do you consider it a bad choice?
>>
>> Not trying to be pedantic or combative, but you need to do better than 
>> just throw an opinion. I’m open to discussing the opinion so that everyone, 
>> including myself, has a chance to learn.
>>
>> On Jul 17, 2020, at 5:01 PM, James Stallings II <[email protected] 
>> <javascript:>> wrote:
>>
>> doing this would be misleading,and so a bad choice in any case.
>>
>> On Fri, Jul 17, 2020 at 3:02 PM Charles McKnight <[email protected] 
>> <javascript:>> wrote:
>>
>>> So why not just catch the event to close the window and do nothing with 
>>> it? 🤔
>>>
>>> On Jul 17, 2020, at 10:12 AM, James Stallings II <[email protected] 
>>> <javascript:>> wrote:
>>>
>>> There are usecases just beyond mainstream where you want the desktop 
>>> locked down in no uncertain terms.
>>>
>>> In my particular case, I am developing with an embedded raspberry pi in 
>>> the interest of implementing an automated vendor. Neither operator nor the 
>>> customer who procure from the vendor should ever, under any circumstances 
>>> have access to the operating system or desktop.
>>>
>>> I am certain beyond doubt that my usecase is anything but unique.
>>>
>>>
>>> On Fri, Jul 17, 2020 at 12:07 PM Matt Newville <
>>> [email protected] <javascript:>> wrote:
>>>
>>>> Hi, 
>>>>
>>>>
>>>>
>>>> On Fri, Jul 17, 2020 at 11:45 AM Matthias Brennwald <[email protected] 
>>>> <javascript:>> 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.
>>>>>
>>>>> 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?
>>>>>
>>>>
>>>> I would suggest raising a dialog window that explains why you don't 
>>>> want them to close the window and provide a "really close" option that does 
>>>> really close the window.
>>>>
>>>> --Matt 
>>>>
>>>>
>>>> -- 
>>>> 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] <javascript:>.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/wxpython-users/CA%2B7ESbqioUALJDFe%2B19rvPLnZ4QpV7Eh3XKzypgkaneuN7h3ug%40mail.gmail.com 
>>>> <https://groups.google.com/d/msgid/wxpython-users/CA%2B7ESbqioUALJDFe%2B19rvPLnZ4QpV7Eh3XKzypgkaneuN7h3ug%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] <javascript:>.
>>>
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/wxpython-users/CAOaG_2Zp0-MMzC9NZkR6B8zV226QSrD2HqxeCK0RqVmktKt35w%40mail.gmail.com 
>>> <https://groups.google.com/d/msgid/wxpython-users/CAOaG_2Zp0-MMzC9NZkR6B8zV226QSrD2HqxeCK0RqVmktKt35w%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] <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/wxpython-users/68478310-44DD-42D4-815E-C318D36EEA5F%40gmail.com 
>>> <https://groups.google.com/d/msgid/wxpython-users/68478310-44DD-42D4-815E-C318D36EEA5F%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] <javascript:>.
>>
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/wxpython-users/CAOaG_2YmYijr8tZyO4xj45h_FYccQBz7PY4jxAAxCN9uc1UcHQ%40mail.gmail.com 
>> <https://groups.google.com/d/msgid/wxpython-users/CAOaG_2YmYijr8tZyO4xj45h_FYccQBz7PY4jxAAxCN9uc1UcHQ%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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/wxpython-users/6D606548-886A-4C47-8ECA-EFCF7F5D35FA%40gmail.com 
>> <https://groups.google.com/d/msgid/wxpython-users/6D606548-886A-4C47-8ECA-EFCF7F5D35FA%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/2c7202e5-5728-4037-9d84-c3720658cfabo%40googlegroups.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.