At Tue, 25 Jun 2024 08:14:13 -0700 Jacob <
[email protected]> wrote:
On 6/24/2024 12:19 PM, Robert Heller wrote:
At Mon, 24 Jun 2024 10:49:16 -0700 Jacob <[email protected]> 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
[email protected] -- Webhosting Services
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)