Re: Closing a tclkit

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Closing a tclkit
De : heller (at) *nospam* deepsoft.com (Robert Heller)
Groupes : comp.lang.tcl
Date : 25. Jun 2024, 18:27:38
Autres entêtes
Organisation : Deepwoods Software
Message-ID : <doicnQrrvLaXY-f7nZ2dnZfqn_udnZ2d@giganews.com>
References : 1 2
User-Agent : TkNews 3.0 (1.2.18)
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
                                                               

Date Sujet#  Auteur
24 Jun 24 * Closing a tclkit6Jacob
24 Jun 24 +- Re: Closing a tclkit1Jacob
24 Jun 24 +* Re: Closing a tclkit3Robert Heller
25 Jun 24 i`* Re: Closing a tclkit2Jacob
25 Jun 24 i `- Re: Closing a tclkit1Robert Heller
27 Jun 24 `- Re: Closing a tclkit1Andreas Leitgeb

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal