Skip to content

Commit 577002d

Browse files
committed
Do not use the Tk console on Windows.
Using the standard Win32 console instead is easier and results in a more usable application. It also allows us to simplify the default windowsScript to just two lines. To enable this change the Windows Tclkit has been updated to a version built without Tk.
1 parent 99dffea commit 577002d

4 files changed

+4
-40
lines changed
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tclssg-667a895c2b-tclkit-8.6.3-win32.exe built {2015-02-18 15:19:28 UTC} from https://github.com/tclssg/tclssg commit 667a895c2bb3432084e64919a726fd0bafd11214.

packer.tcl

+3-40
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package require Tcl 8.5
77

88
namespace eval ::packer {
9-
variable version 0.3
9+
variable version 0.5
1010
}
1111

1212
proc ::packer::init {} {
@@ -52,45 +52,8 @@ proc ::packer::init {} {
5252
# Windows. If set and not empty it is run *instead of* simply sourcing
5353
# the file in fileToSource like on other platforms.
5454
windowsScript {{fileToSource argv0 argv} {
55-
# This anonymous function sets up the console window, creates a new
56-
# thread for Tclssg and makes sure Tclssg's output goes in the said
57-
# console window, asynchronously.
58-
package require Tk
59-
wm withdraw .
60-
console show
61-
console title Tclssg
62-
63-
# Quit when the console window is closed.
64-
console eval {
65-
wm protocol . WM_DELETE_WINDOW {
66-
consoleinterp eval {
67-
exit 0
68-
}
69-
}
70-
set ::tk::console::maxLines 5000
71-
}
72-
73-
# Run Tclssg in a separate thread.
74-
package require Thread
75-
set tid [::thread::create]
76-
::thread::send $tid [list source $fileToSource]
77-
::thread::send $tid [list set argv0 $argv0]
78-
::thread::send $tid [list set argv $argv]
79-
::thread::send $tid [list apply {{consoleThread} {
80-
rename puts puts-old
81-
proc puts args [list apply {{consoleThread} {
82-
upvar 1 args args
83-
if {[llength $args] == 1} {
84-
::thread::send $consoleThread [list puts {*}$args]
85-
} else {
86-
puts-old {*}$args
87-
}
88-
}} $consoleThread]
89-
}} [::thread::id]]
90-
::thread::send -async $tid {
91-
::tclssg::main $argv0 $argv
92-
} done
93-
vwait done
55+
source $fileToSource
56+
::tclssg::main $argv0 $argv
9457
}}
9558

9659
# Command line options to run the Starpack with once it has been built.

tclkit-8.6.3-win32.exe

-1.51 MB
Binary file not shown.

0 commit comments

Comments
 (0)