0

Please answer this question in support with links of available software (with appropriate s/w version that can support that) and with clear one-on-one steps.

Sample tcl/tk program to convert into executables :

#!/usr/bin/wish

proc every {ms body} {eval $body; after $ms [info level 0]}

proc drawhands w {
    $w delete hands
    set secSinceMidnight [expr {[clock sec]-[clock scan 00:00:00]}]
    foreach divisor {60 3600 43200} length {45 40 30} width {1 3 7} {
       set angle [expr {$secSinceMidnight * 6.283185 / $divisor}]
       set x [expr {50 + $length * sin($angle)}]
       set y [expr {50 - $length * cos($angle)}]
       $w create line 50 50 $x $y -width $width -tags hands
    }
}
proc toggle {w1 w2} {
    if [winfo ismapped $w2] {
        foreach {w2 w1} [list $w1 $w2] break ;# swap
    }
    pack forget $w1
    pack $w2
}
#-- Creating the analog clock:
canvas .analog -width 100 -height 100 -bg white
every 1000 {drawhands .analog}
pack .analog

#-- Creating the digital clock:
label .digital -textvar ::time -font {Courier 24}
every 1000 {set ::time [clock format [clock sec] -format %H:%M:%S]}

bind . <1> {toggle .analog .digital}
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • Does this link answer your question ? https://wiki.tcl-lang.org/page/How+to+compile+a+TCL+script+into+an+EXE+program – Mkn Nov 24 '20 at 11:35
  • No, i already tried that. – Aman Agrawal Nov 24 '20 at 11:45
  • and this ? http://tclexecomp.sourceforge.net/index.html ; http://freewrap.sourceforge.net/ – Mkn Nov 24 '20 at 11:51
  • will you please try them first and if they work then please let me know, i tried many things for that but nothing works – Aman Agrawal Nov 24 '20 at 11:58
  • If you know python, you could reconstruct this in python and then try to make a executable with python(easier) – Delrius Euphoria Nov 24 '20 at 12:01
  • 1
    Maybe you can edit your question with the different things you have tried and where you have encountered problems... – Mkn Nov 24 '20 at 12:10
  • 1
    an example with freewrap on Windows : https://fromsmash.com/298n2A.HyE-ct I can’t test on Linux... – Mkn Nov 24 '20 at 12:45
  • Thank you Mkn, please share that software with google link or something, I already try downloading freewrap from sourcenet but version issues, in new version this thing is not there. Please share complete software – Aman Agrawal Nov 24 '20 at 13:00
  • 1
    Same link as you (I think...): https://sourceforge.net/projects/freewrap/files/freewrap/freeWrap%206.73/ – Mkn Nov 24 '20 at 13:09
  • Does this answer your question? [The Simplest Steps to Converting TCL TK to a Stand Alone Application](https://stackoverflow.com/questions/1362788/the-simplest-steps-to-converting-tcl-tk-to-a-stand-alone-application) – Bryan Oakley Nov 24 '20 at 14:07
  • its working, thank you Mkn. Previously i downloaded wrong version from same site. Thank you so much!! – Aman Agrawal Nov 24 '20 at 14:08
  • It would be interesting to see if we can get the single-file executable work we've been doing in 8.7 working with this. I've checked that it works (with careful choice of build) in Tcl 8.7, but I've not extended the testing to Tk. – Donal Fellows Nov 24 '20 at 21:27

1 Answers1

0

For windows and linux:

  1. download freewrap673.zip and freewrap673.tar.gz respectively from https://sourceforge.net/projects/freewrap/files/freewrap/freeWrap%206.73/

  2. extract them

  3. go to win64 for windows64bit system, go to linux64 for linux64bit system

  4. copy your .tcl files into this folder

  5. Run using :

    freewrap filename.tcl for windows
    ./freewrap filename.tcl for linux

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215