Robert Heller <
hel...@deepsoft.com> wrote:
> At Wed, 11 Sep 2019 13:26:11 -0700 (PDT) Juge <
jyrki.m...@gmail.com> wrote:
>> Am Mittwoch, 11. September 2019 21:43:03 UTC+2 schrieb Rich:
>> > This is not the command you are looking for.
>> > You are looking for 'wm protocol' and the protocol name WM_DELETE_WINDOW.
>> Ok, how can I catch this and make it execute my proc?
> wm protocol .window WM_DELETE_WINDOW [list myproc .window]
> proc myproc {somewidow} {
> puts stderr "Opps. $somewidow was closed"
> }
This indicates a slight misconception:
The puts shall rather say: "user expressed a wish to close $somewindow"
The code you showed (of course regardless of the actual message) does
not close the window.
Once you register a callback, it is then the callback's responsibility
to either close the window or not-close it (e.g. when there is unsaved
data and user declines some "close anyway?"-popup).