• Re: Closing a tclkit

    From Jacob@21:1/5 to Jacob on Mon Jun 24 10:56:51 2024
    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).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jacob@21:1/5 to All on Mon Jun 24 10:49:16 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Heller@21:1/5 to JacobLambeth@clevelandgolf.com on Mon Jun 24 19:19:56 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jacob@21:1/5 to Robert Heller on Tue Jun 25 08:14:13 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Heller@21:1/5 to JacobLambeth@clevelandgolf.com on Tue Jun 25 17:27:38 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Leitgeb@21:1/5 to All on Thu Jun 27 15:32:43 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)