summaryrefslogtreecommitdiffstats
path: root/library/demos
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-22 08:41:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-22 08:41:11 (GMT)
commit57eaec1ea3999782e496cbc34ca0e1df6615b82f (patch)
tree3379a28f80f03e86d06cf343facfe551366f142c /library/demos
parentea46afa849cd4996b2897694cdb3b3b0150c5518 (diff)
downloadtk-57eaec1ea3999782e496cbc34ca0e1df6615b82f.zip
tk-57eaec1ea3999782e496cbc34ca0e1df6615b82f.tar.gz
tk-57eaec1ea3999782e496cbc34ca0e1df6615b82f.tar.bz2
Assume utf-8 encoding for demo's (although they actually are still ASCII)
Diffstat (limited to 'library/demos')
-rw-r--r--library/demos/tree.tcl1
-rw-r--r--library/demos/widget11
2 files changed, 7 insertions, 5 deletions
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: