• Re: running TCL/tk from a batch file in Windows

    From Rich@21:1/5 to Mark Tarver on Tue Jan 30 16:24:33 2024
    Mark Tarver <dr.mtarver@gmail.com> wrote:
    I want to run TCL/tk from a batch file in Windows. My event loop
    program loads if I click on the file eventloop.tcl and I get a widget
    window. What I want to do is get exactly the same thing from a batch
    file.

    Then have the batch file run:

    wish.exe eventloop.tcl

    somewhere within it. Note that if wish.exe is not on your PATH you man
    have to give the full path to wish.exe (i.e. something like: c:\Users\Someone\Tcl\bin\wish.exe)

    Now, if you mean something else, you'll need to be more specific as to
    what you really mean.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Tue Jan 30 18:12:31 2024
    * Mark Tarver <dr.mtarver@gmail.com>
    | On Tuesday 30 January 2024 at 16:24:37 UTC, Rich wrote:
    | > Mark Tarver <dr.mt...@gmail.com> wrote:
    | > > I want to run TCL/tk from a batch file in Windows. My event loop
    | > > program loads if I click on the file eventloop.tcl and I get a widget
    | > > window. What I want to do is get exactly the same thing from a batch
    | > > file.
    | > Then have the batch file run:
    | >
    | > wish.exe eventloop.tcl
    | >
    | > somewhere within it. Note that if wish.exe is not on your PATH you man
    | > have to give the full path to wish.exe (i.e. something like:
    | > c:\Users\Someone\Tcl\bin\wish.exe)
    | >
    | > Now, if you mean something else, you'll need to be more specific as to
    | > what you really mean.
    | I've done this as directed; but what I get is a brief flicker of a window (WISH?)
    | and then zip. If I click on eventloop.tcl directly I get WISH presumably with
    | eventloop.tcl loaded.

    Add a 'pause' statement after wish.exe to see error messages in the .bat console window while debugging the batch script.

    wish.exe eventloop.tcl
    pause

    It might be that you need to specify both wish.exe and eventloop.tcl with
    full path names.

    c:\ProgramFiles\tcl\wish.exe c:\users\blah\tcl\eventloop.tcl
    pause

    HTH
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Tue Jan 30 19:13:54 2024
    * Mark Tarver <dr.mtarver@gmail.com>
    | I tried this

    | C:\ActiveTcl\bin\wish86t.exe -encoding "C:\Users\shend\OneDrive\Desktop\Shen\S38\Tk\eventloop.tcl"

    Note that an argument like 'utf-8' is required after -encoding, not
    directly the file name (this might be why you get a TCL console, not
    sure).

    | which worked BUT I got a command window and a TCL console for free
    | which I did not want. :(

    A .bat *always* gets a command window, which you can set to "minimized
    on startup" in the properties of the .bat, but AFAIK it will always be there.

    Maybe you want a desktop link to the .tcl file instead?

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Mark Tarver on Tue Jan 30 17:35:11 2024
    On 1/30/2024 3:38 AM, Mark Tarver wrote:
    I want to run TCL/tk from a batch file in Windows. My event loop program loads if I click on the file eventloop.tcl and I get a widget window. What I want to do is get exactly the same thing from a batch file.


    Have you tried:

    start /min <path>\wish <path>\eventloop.tcl

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