diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/console.tcl | 2 | ||||
-rw-r--r-- | library/demos/bind.tcl | 12 | ||||
-rw-r--r-- | library/demos/tclIndex | 118 | ||||
-rw-r--r-- | library/demos/tree.tcl | 1 | ||||
-rw-r--r-- | library/demos/widget | 11 | ||||
-rw-r--r-- | library/tk.tcl | 6 | ||||
-rw-r--r-- | library/ttk/ttk.tcl | 34 |
7 files changed, 93 insertions, 91 deletions
diff --git a/library/console.tcl b/library/console.tcl index 4e2b9d0..30c4d88 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -592,7 +592,7 @@ proc ::tk::ConsoleBind {w} { } bind Console <F9> { eval destroy [winfo child .] - source [file join $tk_library console.tcl] + source -encoding utf-8 [file join $tk_library console.tcl] } if {[tk windowingsystem] eq "aqua"} { bind Console <Command-q> { diff --git a/library/demos/bind.tcl b/library/demos/bind.tcl index 9146362..8b56639 100644 --- a/library/demos/bind.tcl +++ b/library/demos/bind.tcl @@ -67,12 +67,12 @@ foreach tag {d1 d2 d3 d4 d5 d6} { $w.text tag bind $tag <Leave> "$w.text tag configure $tag $normal" } # Main widget program sets variable tk_demoDirectory -$w.text tag bind d1 <Button-1> {source [file join $tk_demoDirectory items.tcl]} -$w.text tag bind d2 <Button-1> {source [file join $tk_demoDirectory plot.tcl]} -$w.text tag bind d3 <Button-1> {source [file join $tk_demoDirectory ctext.tcl]} -$w.text tag bind d4 <Button-1> {source [file join $tk_demoDirectory arrow.tcl]} -$w.text tag bind d5 <Button-1> {source [file join $tk_demoDirectory ruler.tcl]} -$w.text tag bind d6 <Button-1> {source [file join $tk_demoDirectory cscroll.tcl]} +$w.text tag bind d1 <Button-1> {source -encoding utf-8 [file join $tk_demoDirectory items.tcl]} +$w.text tag bind d2 <Button-1> {source -encoding utf-8 [file join $tk_demoDirectory plot.tcl]} +$w.text tag bind d3 <Button-1> {source -encoding utf-8 [file join $tk_demoDirectory ctext.tcl]} +$w.text tag bind d4 <Button-1> {source -encoding utf-8 [file join $tk_demoDirectory arrow.tcl]} +$w.text tag bind d5 <Button-1> {source -encoding utf-8 [file join $tk_demoDirectory ruler.tcl]} +$w.text tag bind d6 <Button-1> {source -encoding utf-8 [file join $tk_demoDirectory cscroll.tcl]} $w.text mark set insert 0.0 $w.text configure -state disabled diff --git a/library/demos/tclIndex b/library/demos/tclIndex index 86a72e2..cdb2f2c 100644 --- a/library/demos/tclIndex +++ b/library/demos/tclIndex @@ -6,62 +6,62 @@ # element name is the name of a command and the value is # a script that loads the command. -set auto_index(arrowSetup) [list source [file join $dir arrow.tcl]] -set auto_index(arrowMove1) [list source [file join $dir arrow.tcl]] -set auto_index(arrowMove2) [list source [file join $dir arrow.tcl]] -set auto_index(arrowMove3) [list source [file join $dir arrow.tcl]] -set auto_index(textLoadFile) [list source [file join $dir search.tcl]] -set auto_index(textSearch) [list source [file join $dir search.tcl]] -set auto_index(textToggle) [list source [file join $dir search.tcl]] -set auto_index(itemEnter) [list source [file join $dir items.tcl]] -set auto_index(itemLeave) [list source [file join $dir items.tcl]] -set auto_index(itemMark) [list source [file join $dir items.tcl]] -set auto_index(itemStroke) [list source [file join $dir items.tcl]] -set auto_index(itemsUnderArea) [list source [file join $dir items.tcl]] -set auto_index(itemStartDrag) [list source [file join $dir items.tcl]] -set auto_index(itemDrag) [list source [file join $dir items.tcl]] -set auto_index(butPress) [list source [file join $dir items.tcl]] -set auto_index(loadDir) [list source [file join $dir image2.tcl]] -set auto_index(loadImage) [list source [file join $dir image2.tcl]] -set auto_index(rulerMkTab) [list source [file join $dir ruler.tcl]] -set auto_index(rulerNewTab) [list source [file join $dir ruler.tcl]] -set auto_index(rulerSelectTab) [list source [file join $dir ruler.tcl]] -set auto_index(rulerMoveTab) [list source [file join $dir ruler.tcl]] -set auto_index(rulerReleaseTab) [list source [file join $dir ruler.tcl]] -set auto_index(mkTextConfig) [list source [file join $dir ctext.tcl]] -set auto_index(textEnter) [list source [file join $dir ctext.tcl]] -set auto_index(textInsert) [list source [file join $dir ctext.tcl]] -set auto_index(textPaste) [list source [file join $dir ctext.tcl]] -set auto_index(textB1Press) [list source [file join $dir ctext.tcl]] -set auto_index(textB1Move) [list source [file join $dir ctext.tcl]] -set auto_index(textBs) [list source [file join $dir ctext.tcl]] -set auto_index(textDel) [list source [file join $dir ctext.tcl]] -set auto_index(bitmapRow) [list source [file join $dir bitmap.tcl]] -set auto_index(scrollEnter) [list source [file join $dir cscroll.tcl]] -set auto_index(scrollLeave) [list source [file join $dir cscroll.tcl]] -set auto_index(scrollButton) [list source [file join $dir cscroll.tcl]] -set auto_index(textWindOn) [list source [file join $dir twind.tcl]] -set auto_index(textWindOff) [list source [file join $dir twind.tcl]] -set auto_index(textWindPlot) [list source [file join $dir twind.tcl]] -set auto_index(embPlotDown) [list source [file join $dir twind.tcl]] -set auto_index(embPlotMove) [list source [file join $dir twind.tcl]] -set auto_index(textWindDel) [list source [file join $dir twind.tcl]] -set auto_index(embDefBg) [list source [file join $dir twind.tcl]] -set auto_index(floorDisplay) [list source [file join $dir floor.tcl]] -set auto_index(newRoom) [list source [file join $dir floor.tcl]] -set auto_index(roomChanged) [list source [file join $dir floor.tcl]] -set auto_index(bg1) [list source [file join $dir floor.tcl]] -set auto_index(bg2) [list source [file join $dir floor.tcl]] -set auto_index(bg3) [list source [file join $dir floor.tcl]] -set auto_index(fg1) [list source [file join $dir floor.tcl]] -set auto_index(fg2) [list source [file join $dir floor.tcl]] -set auto_index(fg3) [list source [file join $dir floor.tcl]] -set auto_index(setWidth) [list source [file join $dir hscale.tcl]] -set auto_index(plotDown) [list source [file join $dir plot.tcl]] -set auto_index(plotMove) [list source [file join $dir plot.tcl]] -set auto_index(puzzleSwitch) [list source [file join $dir puzzle.tcl]] -set auto_index(setHeight) [list source [file join $dir vscale.tcl]] -set auto_index(showMessageBox) [list source [file join $dir msgbox.tcl]] -set auto_index(setColor) [list source [file join $dir clrpick.tcl]] -set auto_index(setColor_helper) [list source [file join $dir clrpick.tcl]] -set auto_index(fileDialog) [list source [file join $dir filebox.tcl]] +set auto_index(arrowSetup) [list source -encoding utf-8 [file join $dir arrow.tcl]] +set auto_index(arrowMove1) [list source -encoding utf-8 [file join $dir arrow.tcl]] +set auto_index(arrowMove2) [list source -encoding utf-8 [file join $dir arrow.tcl]] +set auto_index(arrowMove3) [list source -encoding utf-8 [file join $dir arrow.tcl]] +set auto_index(textLoadFile) [list source -encoding utf-8 [file join $dir search.tcl]] +set auto_index(textSearch) [list source -encoding utf-8 [file join $dir search.tcl]] +set auto_index(textToggle) [list source -encoding utf-8 [file join $dir search.tcl]] +set auto_index(itemEnter) [list source -encoding utf-8 [file join $dir items.tcl]] +set auto_index(itemLeave) [list source -encoding utf-8 [file join $dir items.tcl]] +set auto_index(itemMark) [list source -encoding utf-8 [file join $dir items.tcl]] +set auto_index(itemStroke) [list source -encoding utf-8 [file join $dir items.tcl]] +set auto_index(itemsUnderArea) [list source -encoding utf-8 [file join $dir items.tcl]] +set auto_index(itemStartDrag) [list source -encoding utf-8 [file join $dir items.tcl]] +set auto_index(itemDrag) [list source -encoding utf-8 [file join $dir items.tcl]] +set auto_index(butPress) [list source -encoding utf-8 [file join $dir items.tcl]] +set auto_index(loadDir) [list source -encoding utf-8 [file join $dir image2.tcl]] +set auto_index(loadImage) [list source -encoding utf-8 [file join $dir image2.tcl]] +set auto_index(rulerMkTab) [list source -encoding utf-8 [file join $dir ruler.tcl]] +set auto_index(rulerNewTab) [list source -encoding utf-8 [file join $dir ruler.tcl]] +set auto_index(rulerSelectTab) [list source -encoding utf-8 [file join $dir ruler.tcl]] +set auto_index(rulerMoveTab) [list source -encoding utf-8 [file join $dir ruler.tcl]] +set auto_index(rulerReleaseTab) [list source -encoding utf-8 [file join $dir ruler.tcl]] +set auto_index(mkTextConfig) [list source -encoding utf-8 [file join $dir ctext.tcl]] +set auto_index(textEnter) [list source -encoding utf-8 [file join $dir ctext.tcl]] +set auto_index(textInsert) [list source -encoding utf-8 [file join $dir ctext.tcl]] +set auto_index(textPaste) [list source -encoding utf-8 [file join $dir ctext.tcl]] +set auto_index(textB1Press) [list source -encoding utf-8 [file join $dir ctext.tcl]] +set auto_index(textB1Move) [list source -encoding utf-8 [file join $dir ctext.tcl]] +set auto_index(textBs) [list source -encoding utf-8 [file join $dir ctext.tcl]] +set auto_index(textDel) [list source -encoding utf-8 [file join $dir ctext.tcl]] +set auto_index(bitmapRow) [list source -encoding utf-8 [file join $dir bitmap.tcl]] +set auto_index(scrollEnter) [list source -encoding utf-8 [file join $dir cscroll.tcl]] +set auto_index(scrollLeave) [list source -encoding utf-8 [file join $dir cscroll.tcl]] +set auto_index(scrollButton) [list source -encoding utf-8 [file join $dir cscroll.tcl]] +set auto_index(textWindOn) [list source -encoding utf-8 [file join $dir twind.tcl]] +set auto_index(textWindOff) [list source -encoding utf-8 [file join $dir twind.tcl]] +set auto_index(textWindPlot) [list source -encoding utf-8 [file join $dir twind.tcl]] +set auto_index(embPlotDown) [list source -encoding utf-8 [file join $dir twind.tcl]] +set auto_index(embPlotMove) [list source -encoding utf-8 [file join $dir twind.tcl]] +set auto_index(textWindDel) [list source -encoding utf-8 [file join $dir twind.tcl]] +set auto_index(embDefBg) [list source -encoding utf-8 [file join $dir twind.tcl]] +set auto_index(floorDisplay) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(newRoom) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(roomChanged) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(bg1) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(bg2) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(bg3) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(fg1) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(fg2) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(fg3) [list source -encoding utf-8 [file join $dir floor.tcl]] +set auto_index(setWidth) [list source -encoding utf-8 [file join $dir hscale.tcl]] +set auto_index(plotDown) [list source -encoding utf-8 [file join $dir plot.tcl]] +set auto_index(plotMove) [list source -encoding utf-8 [file join $dir plot.tcl]] +set auto_index(puzzleSwitch) [list source -encoding utf-8 [file join $dir puzzle.tcl]] +set auto_index(setHeight) [list source -encoding utf-8 [file join $dir vscale.tcl]] +set auto_index(showMessageBox) [list source -encoding utf-8 [file join $dir msgbox.tcl]] +set auto_index(setColor) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(setColor_helper) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(fileDialog) [list source -encoding utf-8 [file join $dir filebox.tcl]] diff --git a/library/demos/tree.tcl b/library/demos/tree.tcl index 8decdf2..1cc70f8 100644 --- a/library/demos/tree.tcl +++ b/library/demos/tree.tcl @@ -39,6 +39,7 @@ proc populateTree {tree node} { set path [$tree set $node fullpath] $tree delete [$tree children $node] foreach f [lsort -dictionary [glob -nocomplain -dir $path *]] { + set f [file normalize $f] set type [file type $f] set id [$tree insert $node end -text [file tail $f] \ -values [list $f $type]] diff --git a/library/demos/widget b/library/demos/widget index e543846..58da12f 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -516,7 +516,7 @@ proc invoke index { .t configure -cursor [::ttk::cursor busy] update set demo [string range [lindex $tags $i] 5 end] - uplevel 1 [list source [file join $tk_demoDirectory $demo.tcl]] + uplevel 1 [list source -encoding utf-8 [file join $tk_demoDirectory $demo.tcl]] update .t configure -cursor $cursor @@ -624,6 +624,7 @@ proc showCode w { wm title $top [mc "Demo code: %s" [file join $tk_demoDirectory $file]] wm iconname $top $file set id [open [file join $tk_demoDirectory $file]] + fconfigure $id -encoding utf-8 -eofchar \032 $top.f.text delete 1.0 end $top.f.text insert 1.0 [read $id] $top.f.text mark set insert 1.0 @@ -722,10 +723,10 @@ proc PrintTextWin32 {filename} { proc tkAboutDialog {} { tk_messageBox -icon info -type ok -title [mc "About Widget Demo"] \ -message [mc "Tk widget demonstration application"] -detail \ -"[mc "Copyright \u00a9 %s" {1996-1997 Sun Microsystems, Inc.}] -[mc "Copyright \u00a9 %s" {1997-2000 Ajuba Solutions, Inc.}] -[mc "Copyright \u00a9 %s" {2001-2009 Donal K. Fellows}] -[mc "Copyright \u00a9 %s" {2002-2007 Daniel A. Steffen}]" +"[mc "Copyright \xA9 %s" {1996-1997 Sun Microsystems, Inc.}] +[mc "Copyright \xA9 %s" {1997-2000 Ajuba Solutions, Inc.}] +[mc "Copyright \xA9 %s" {2001-2009 Donal K. Fellows}] +[mc "Copyright \xA9 %s" {2002-2007 Daniel A. Steffen}]" } # Local Variables: diff --git a/library/tk.tcl b/library/tk.tcl index cf2edd5..0715489 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -496,7 +496,7 @@ switch -exact -- [tk windowingsystem] { if {$::tk_library ne ""} { proc ::tk::SourceLibFile {file} { - namespace eval :: [list source [file join $::tk_library $file.tcl]] + namespace eval :: [list source -encoding utf-8 [file join $::tk_library $file.tcl]] } namespace eval ::tk { SourceLibFile icons @@ -688,7 +688,7 @@ if {[tk windowingsystem] eq "aqua"} { #stub procedures to respond to "do script" Apple Events proc ::tk::mac::DoScriptFile {file} { uplevel #0 $file - source $file + source -encoding utf-8 $file } proc ::tk::mac::DoScriptText {script} { uplevel #0 $script @@ -703,7 +703,7 @@ set ::tk::Priv(IMETextMark) [dict create] # Run the Ttk themed widget set initialization if {$::ttk::library ne ""} { - uplevel \#0 [list source $::ttk::library/ttk.tcl] + uplevel \#0 [list source -encoding utf-8 $::ttk::library/ttk.tcl] } # Local Variables: diff --git a/library/ttk/ttk.tcl b/library/ttk/ttk.tcl index 665222d..73ee3d9 100644 --- a/library/ttk/ttk.tcl +++ b/library/ttk/ttk.tcl @@ -12,9 +12,9 @@ namespace eval ::ttk { } } -source [file join $::ttk::library fonts.tcl] -source [file join $::ttk::library cursors.tcl] -source [file join $::ttk::library utils.tcl] +source -encoding utf-8 [file join $::ttk::library fonts.tcl] +source -encoding utf-8 [file join $::ttk::library cursors.tcl] +source -encoding utf-8 [file join $::ttk::library utils.tcl] ## ttk::deprecated $old $new -- # Define $old command as a deprecated alias for $new command @@ -97,18 +97,18 @@ proc ::ttk::setTheme {theme} { ### Load widget bindings. # -source [file join $::ttk::library button.tcl] -source [file join $::ttk::library menubutton.tcl] -source [file join $::ttk::library scrollbar.tcl] -source [file join $::ttk::library scale.tcl] -source [file join $::ttk::library progress.tcl] -source [file join $::ttk::library notebook.tcl] -source [file join $::ttk::library panedwindow.tcl] -source [file join $::ttk::library entry.tcl] -source [file join $::ttk::library combobox.tcl] ;# dependency: entry.tcl -source [file join $::ttk::library spinbox.tcl] ;# dependency: entry.tcl -source [file join $::ttk::library treeview.tcl] -source [file join $::ttk::library sizegrip.tcl] +source -encoding utf-8 [file join $::ttk::library button.tcl] +source -encoding utf-8 [file join $::ttk::library menubutton.tcl] +source -encoding utf-8 [file join $::ttk::library scrollbar.tcl] +source -encoding utf-8 [file join $::ttk::library scale.tcl] +source -encoding utf-8 [file join $::ttk::library progress.tcl] +source -encoding utf-8 [file join $::ttk::library notebook.tcl] +source -encoding utf-8 [file join $::ttk::library panedwindow.tcl] +source -encoding utf-8 [file join $::ttk::library entry.tcl] +source -encoding utf-8 [file join $::ttk::library combobox.tcl] ;# dependency: entry.tcl +source -encoding utf-8 [file join $::ttk::library spinbox.tcl] ;# dependency: entry.tcl +source -encoding utf-8 [file join $::ttk::library treeview.tcl] +source -encoding utf-8 [file join $::ttk::library sizegrip.tcl] ## Label and Labelframe bindings: # (not enough to justify their own file...) @@ -122,7 +122,7 @@ proc ttk::LoadThemes {} { variable library # "default" always present: - uplevel #0 [list source [file join $library defaults.tcl]] + uplevel #0 [list source -encoding utf-8 [file join $library defaults.tcl]] set builtinThemes [style theme names] foreach {theme scripts} { @@ -135,7 +135,7 @@ proc ttk::LoadThemes {} { } { if {[lsearch -exact $builtinThemes $theme] >= 0} { foreach script $scripts { - uplevel #0 [list source [file join $library $script]] + uplevel #0 [list source -encoding utf-8 [file join $library $script]] } } } |