Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #397: T-1's congested due to porn traffic to the news server.


comp / comp.lang.tcl / Closing a tclkit

SubjectAuthor
* Closing a tclkitJacob
+- Re: Closing a tclkitJacob
+* Re: Closing a tclkitRobert Heller
|`* Re: Closing a tclkitJacob
| `- Re: Closing a tclkitRobert Heller
`- Re: Closing a tclkitAndreas Leitgeb

1
Subject: Closing a tclkit
From: Jacob
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 24 Jun 2024 17:49 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: JacobLambeth@clevelandgolf.com (Jacob)
Newsgroups: comp.lang.tcl
Subject: Closing a tclkit
Date: Mon, 24 Jun 2024 10:49:16 -0700
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <v5cbis$11tii$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 24 Jun 2024 19:49:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c18c4968f1255a29b7054e2abff56da8";
logging-data="1111634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+N4hpLX/V76mjy/A6tgeQEco5PVH4B4fU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gniNgvQ9yxJjslLUszXRRxHfctY=
Content-Language: en-US
View all headers

Hello,

I have a program that runs inside a tclkit (windows exe). Whenever I
close the program by clicking the "X", the tclkit still says its running
the task manager. Are there any tips on how to properly close a tclkit?
Right now, I simply have an exit command binded to the window.

bind . <Destroy> {
exit
}

Thanks,

Jacob

Subject: Re: Closing a tclkit
From: Jacob
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Mon, 24 Jun 2024 17:56 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: JacobLambeth@clevelandgolf.com (Jacob)
Newsgroups: comp.lang.tcl
Subject: Re: Closing a tclkit
Date: Mon, 24 Jun 2024 10:56:51 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <v5cc14$121e7$1@dont-email.me>
References: <v5cbis$11tii$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 24 Jun 2024 19:56:52 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c18c4968f1255a29b7054e2abff56da8";
logging-data="1115591"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gr4nwgIcAREeWGU+mBLg6AzCmdTSBh+w="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:hvW/rg4Z5e88kuNE838tbWdAIG4=
Content-Language: en-US
In-Reply-To: <v5cbis$11tii$1@dont-email.me>
View all headers

On 6/24/2024 10:49 AM, Jacob wrote:
> Hello,
>
> I have a program that runs inside a tclkit (windows exe). Whenever I
> close the program by clicking the "X", the tclkit still says its running
> the task manager. Are there any tips on how to properly close a tclkit?
> Right now, I simply have an exit command binded to the window.
>
> bind . <Destroy> {
>     exit
> }
>
> Thanks,
>
> Jacob

Technically I think this is a "Starpack" (tclkit+starkit).

Subject: Re: Closing a tclkit
From: Robert Heller
Newsgroups: comp.lang.tcl
Organization: Deepwoods Software
Date: Mon, 24 Jun 2024 19:19 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 24 Jun 2024 19:19:56 +0000
MIME-Version: 1.0
From: heller@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.18)
Subject: Re: Closing a tclkit
In-Reply-To: <v5cbis$11tii$1@dont-email.me>
References: <v5cbis$11tii$1@dont-email.me>
Newsgroups: comp.lang.tcl
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <xPecna6Pi5FBW-T7nZ2dnZfqnPGdnZ2d@giganews.com>
Date: Mon, 24 Jun 2024 19:19:56 +0000
Lines: 43
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-m5brPOa0f2WyOnrJyyhPqYGWlXfwVbiDxnGAU1FRRfNc4Y8yycg19Gw6KtvZHoXAEQ4jwbX4PxPXg5C!//HnqsH/kRXjJA12V7oMF/sHPErJa76UsSfXirWT2S+yHYpY0WUPZhvtMmdWHyQWc2s+ro781Q1F!Tqk=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

At Mon, 24 Jun 2024 10:49:16 -0700 Jacob <JacobLambeth@clevelandgolf.com> wrote:

>
> Hello,
>
> I have a program that runs inside a tclkit (windows exe). Whenever I
> close the program by clicking the "X", the tclkit still says its running
> the task manager. Are there any tips on how to properly close a tclkit?
> Right now, I simply have an exit command binded to the window.
>
> bind . <Destroy> {
> exit
> }
>
> Thanks,

Try adding:

wm protocol . WM_DELETE_WINDOW ::exit

Note: is "." the only toplevel? Is that in fact the toplevel you are
closing?

Have you done something like this?

wm withdraw .

toplevel .mytoplevelui

>
> Jacob
>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Subject: Re: Closing a tclkit
From: Jacob
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Tue, 25 Jun 2024 15:14 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: JacobLambeth@clevelandgolf.com (Jacob)
Newsgroups: comp.lang.tcl
Subject: Re: Closing a tclkit
Date: Tue, 25 Jun 2024 08:14:13 -0700
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <373b32ce-a57d-485a-8ac1-cdc20adb56d4@clevelandgolf.com>
References: <v5cbis$11tii$1@dont-email.me>
<xPecna6Pi5FBW-T7nZ2dnZfqnPGdnZ2d@giganews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 25 Jun 2024 17:14:14 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1d15e186a49d80ed40ba1c2882845e69";
logging-data="1703760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/3PhD0loumShgY7ieNUNzx79xe8dba6kk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ZFQPeZDMGuhK0TfYSNaO21tcsmA=
Content-Language: en-US
In-Reply-To: <xPecna6Pi5FBW-T7nZ2dnZfqnPGdnZ2d@giganews.com>
View all headers

On 6/24/2024 12:19 PM, Robert Heller wrote:
> At Mon, 24 Jun 2024 10:49:16 -0700 Jacob <JacobLambeth@clevelandgolf.com> wrote:
>
>>
>> Hello,
>>
>> I have a program that runs inside a tclkit (windows exe). Whenever I
>> close the program by clicking the "X", the tclkit still says its running
>> the task manager. Are there any tips on how to properly close a tclkit?
>> Right now, I simply have an exit command binded to the window.
>>
>> bind . <Destroy> {
>> exit
>> }
>>
>> Thanks,
>
> Try adding:
>
> wm protocol . WM_DELETE_WINDOW ::exit
>
> Note: is "." the only toplevel? Is that in fact the toplevel you are
> closing?
>
> Have you done something like this?
>
> wm withdraw .
>
> toplevel .mytoplevelui
>
>
>
>
>>
>> Jacob
>>
>>
>
Hi Robert,

Thank you for your recommendation. You were right, I had a separate
toplevel that was not necessary. Also,

wm protocol . WM_DELETE_WINDOW ::exit

Appears to be the better way than binding exit to the destroy callback.

Thanks,

Jacob

Subject: Re: Closing a tclkit
From: Robert Heller
Newsgroups: comp.lang.tcl
Organization: Deepwoods Software
Date: Tue, 25 Jun 2024 17:27 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-2.nntp.ord.giganews.com!border-4.nntp.ord.giganews.com!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 25 Jun 2024 17:27:38 +0000
MIME-Version: 1.0
From: heller@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.18)
Subject: Re: Closing a tclkit
In-Reply-To: <373b32ce-a57d-485a-8ac1-cdc20adb56d4@clevelandgolf.com>
References: <v5cbis$11tii$1@dont-email.me>?
<xPecna6Pi5FBW-T7nZ2dnZfqnPGdnZ2d@giganews.com>
<373b32ce-a57d-485a-8ac1-cdc20adb56d4@clevelandgolf.com>
Newsgroups: comp.lang.tcl
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <doicnQrrvLaXY-f7nZ2dnZfqn_udnZ2d@giganews.com>
Date: Tue, 25 Jun 2024 17:27:38 +0000
Lines: 75
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-zFlA4A8QLn2vdtRcrVoXmtVxlWfqFvnRp7P3sIpUYLTxUqLSIk+DayGe09S864rDvS+R167K0wMP/hH!aGLqKR/ermDydsYC8R7zdxKB6pWyd8u9S7jltXLBg4epFJ6j4wWTysIQcVROIIwMrjFcWBBTK2wd!TyQ=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

At Tue, 25 Jun 2024 08:14:13 -0700 Jacob <JacobLambeth@clevelandgolf.com> wrote:

>
> On 6/24/2024 12:19 PM, Robert Heller wrote:
> > At Mon, 24 Jun 2024 10:49:16 -0700 Jacob <JacobLambeth@clevelandgolf.com> wrote:
> >
> >>
> >> Hello,
> >>
> >> I have a program that runs inside a tclkit (windows exe). Whenever I
> >> close the program by clicking the "X", the tclkit still says its running
> >> the task manager. Are there any tips on how to properly close a tclkit?
> >> Right now, I simply have an exit command binded to the window.
> >>
> >> bind . <Destroy> {
> >> exit
> >> }
> >>
> >> Thanks,
> >
> > Try adding:
> >
> > wm protocol . WM_DELETE_WINDOW ::exit
> >
> > Note: is "." the only toplevel? Is that in fact the toplevel you are
> > closing?
> >
> > Have you done something like this?
> >
> > wm withdraw .
> >
> > toplevel .mytoplevelui
> >
> >
> >
> >
> >>
> >> Jacob
> >>
> >>
> >
> Hi Robert,
>
> Thank you for your recommendation. You were right, I had a separate
> toplevel that was not necessary. Also,
>
> wm protocol . WM_DELETE_WINDOW ::exit
>
> Appears to be the better way than binding exit to the destroy callback.

Right. The WM_DELETE_WINDOW is what is bound to the 'X' or "Close" menu item
in the window manager supplied menu. The destroy binding happens when the
window is actually destroyed, which is actually something different (and not
actually something the window manager does).

I know that people no longer want to include an explicit "Exit" or "Close"
feature in GUIs anymore, and instead are passing that buck to the window
manager, since WM's (always under MS-Windows and MacOSX, by default with
"modern" Linux desktops) are now providing a "standard" close option. But,
*I* always do things old-school and provide an explicit "Exit" or "Close"
feature: an Exit/Close [toolbar] button or Edit and/or Close on the File menu.

>
> Thanks,
>
> Jacob
>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Subject: Re: Closing a tclkit
From: Andreas Leitgeb
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 27 Jun 2024 15:32 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: Closing a tclkit
Date: Thu, 27 Jun 2024 15:32:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <slrnv7r1gq.3gvbf.avl@logic.at>
References: <v5cbis$11tii$1@dont-email.me>
Reply-To: avl@logic.at
Injection-Date: Thu, 27 Jun 2024 17:32:43 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8e74ff785fe80015af8937dfca316e6e";
logging-data="2930263"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OGffPOoYP2Ub4xIrZwXBn"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:IkKKojU9l5FE0NwRQIoJQSrkCGQ=
View all headers

> bind . <Destroy> {
> exit
> }

Just another note on how this is not a good idea:

The window "." is in the default "bindtags"-list of every
widget, be it a frame, a button, or whatever else.

Any (inner) widget will, upon it's own destroyment receive
this event and, due to "." being in the bindtags, invoke
the "."'s handler for Destroy, thus try to re-exit the
application, which already is in progress of exiting...

The proper solution with
wm protocol ...
is somewhere down this thread.

1

rocksolid light 0.9.8
clearnet tor