/
usr
/
share
/
tk8.6
/
demos
/
/usr/share/tk8.6/demos
mkdir
upload
Name
Size
Mode
Actions
images/
-
0755
rm
anilabel.tcl
6670
0644
edit
dl
rm
aniwave.tcl
3494
0644
edit
dl
rm
arrow.tcl
7984
0644
edit
dl
rm
bind.tcl
2948
0644
edit
dl
rm
bitmap.tcl
1411
0644
edit
dl
rm
browse
1758
0755
edit
dl
rm
button.tcl
1504
0644
edit
dl
rm
check.tcl
2278
0644
edit
dl
rm
clrpick.tcl
1431
0644
edit
dl
rm
colors.tcl
4995
0644
edit
dl
rm
combo.tcl
1963
0644
edit
dl
rm
cscroll.tcl
3389
0644
edit
dl
rm
ctext.tcl
6019
0644
edit
dl
rm
dialog1.tcl
660
0644
edit
dl
rm
dialog2.tcl
613
0644
edit
dl
rm
en.msg
3867
0644
edit
dl
rm
entry1.tcl
1385
0644
edit
dl
rm
entry2.tcl
2081
0644
edit
dl
rm
entry3.tcl
6104
0644
edit
dl
rm
filebox.tcl
2351
0644
edit
dl
rm
floor.tcl
79108
0644
edit
dl
rm
fontchoose.tcl
1752
0644
edit
dl
rm
form.tcl
1046
0644
edit
dl
rm
goldberg.tcl
56556
0644
edit
dl
rm
hello
512
0755
edit
dl
rm
hscale.tcl
1497
0644
edit
dl
rm
icon.tcl
2063
0644
edit
dl
rm
image1.tcl
1002
0644
edit
dl
rm
image2.tcl
3352
0644
edit
dl
rm
items.tcl
10133
0644
edit
dl
rm
ixset
8068
0755
edit
dl
rm
knightstour.tcl
9140
0644
edit
dl
rm
label.tcl
1379
0644
edit
dl
rm
labelframe.tcl
1847
0644
edit
dl
rm
license.terms
2267
0644
edit
dl
rm
mclist.tcl
4357
0644
edit
dl
rm
menu.tcl
6778
0644
edit
dl
rm
menubu.tcl
4476
0644
edit
dl
rm
msgbox.tcl
1998
0644
edit
dl
rm
nl.msg
6750
0644
edit
dl
rm
paned1.tcl
1110
0644
edit
dl
rm
paned2.tcl
2244
0644
edit
dl
rm
pendulum.tcl
7596
0644
edit
dl
rm
plot.tcl
2758
0644
edit
dl
rm
puzzle.tcl
2596
0644
edit
dl
rm
radio.tcl
2752
0644
edit
dl
rm
README
2082
0644
edit
dl
rm
rmt
5319
0755
edit
dl
rm
rolodex
8300
0755
edit
dl
rm
ruler.tcl
5211
0644
edit
dl
rm
sayings.tcl
2273
0644
edit
dl
rm
search.tcl
4403
0644
edit
dl
rm
spin.tcl
1820
0644
edit
dl
rm
states.tcl
2048
0644
edit
dl
rm
style.tcl
6943
0644
edit
dl
rm
tclIndex
4354
0644
edit
dl
rm
tcolor
11250
0755
edit
dl
rm
text.tcl
4267
0644
edit
dl
rm
textpeer.tcl
2188
0644
edit
dl
rm
timer
1095
0755
edit
dl
rm
toolbar.tcl
3264
0644
edit
dl
rm
tree.tcl
3162
0644
edit
dl
rm
ttkbut.tcl
3405
0644
edit
dl
rm
ttkmenu.tcl
2391
0644
edit
dl
rm
ttknote.tcl
2317
0644
edit
dl
rm
ttkpane.tcl
4172
0644
edit
dl
rm
ttkprogress.tcl
1536
0644
edit
dl
rm
ttkscale.tcl
1420
0644
edit
dl
rm
twind.tcl
11045
0644
edit
dl
rm
unicodeout.tcl
4399
0644
edit
dl
rm
vscale.tcl
1477
0644
edit
dl
rm
widget
23267
0755
edit
dl
rm
Edit:
/usr/share/tk8.6/demos/unicodeout.tcl
(4399B)
# unicodeout.tcl -- # # This demonstration script shows how you can produce output (in label # widgets) using many different alphabets. if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk set w .unicodeout catch {destroy $w} toplevel $w wm title $w "Unicode Label Demonstration" wm iconname $w "unicodeout" positionWindow $w label $w.msg -font $font -wraplength 4i -anchor w -justify left \ -text "This is a sample of Tk's support for languages that use\ non-Western character sets. However, what you will actually see\ below depends largely on what character sets you have installed,\ and what you see for characters that are not present varies greatly\ between platforms as well. The strings are written in Tcl using\ UNICODE characters using the \\uXXXX escape so as to do so in a\ portable fashion." pack $w.msg -side top ## See Code / Dismiss buttons set btns [addSeeDismiss $w.buttons $w] pack $btns -side bottom -fill x ## The frame that will contain the sample texts. pack [frame $w.f] -side bottom -expand 1 -fill both -padx 2m -pady 1m grid columnconfigure $w.f 1 -weight 1 set i 0 proc addSample {w language args} { global font i set sample [join $args ""] set j [incr i] label $w.f.l$j -font $font -text "${language}:" -anchor nw -pady 0 label $w.f.s$j -font $font -text $sample -anchor nw -width 30 -pady 0 grid $w.f.l$j $w.f.s$j -sticky ew -pady 0 grid configure $w.f.l$j -padx 1m } ## A helper procedure that determines what form to use to express languages ## that have complex rendering rules... proc usePresentationFormsFor {language} { switch [tk windowingsystem] { aqua { # OSX wants natural character order; the renderer knows how to # compose things for display for all languages. return false } x11 { # The X11 font renderers that Tk supports all know nothing about # composing characters, so we need to use presentation forms. return true } win32 { # On Windows, we need to determine whether the font system will # render right-to-left text. This varies by language! try { package require registry set rkey [join { HKEY_LOCAL_MACHINE SOFTWARE Microsoft {Windows NT} CurrentVersion LanguagePack } \\] return [expr { [string toupper $language] ni [registry values $rkey] }] } trap error {} { # Cannot work it out, so use presentation forms. return true } } default { # Default to using presentation forms. return true } } } ## Processing when some characters are not currently cached by the display ## engine might take a while, so make sure we're displaying something in the ## meantime... pack [label $w.wait -text "Please wait while loading fonts..." \ -font {Helvetica 12 italic}] set oldCursor [$w cget -cursor] $w conf -cursor watch update ## Add the samples... if {[usePresentationFormsFor Arabic]} { # Using presentation forms (pre-layouted) addSample $w Arabic \ "\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D " \ "\uFE94\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D" } else { # Using standard text characters addSample $w Arabic \ "\u0627\u0644\u0643\u0644\u0645\u0629 " \ "\u0627\u0644\u0639\u0631\u0628\u064A\u0629" } addSample $w "Trad. Chinese" "\u4E2D\u570B\u7684\u6F22\u5B57" addSample $w "Simpl. Chinese" "\u6C49\u8BED" addSample $w French "Langue fran\u00E7aise" addSample $w Greek \ "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE " \ "\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1" if {[usePresentationFormsFor Hebrew]} { # Visual order (pre-layouted) addSample $w Hebrew \ "\u05EA\u05D9\u05E8\u05D1\u05E2 \u05D1\u05EA\u05DB" } else { # Standard logical order addSample $w Hebrew \ "\u05DB\u05EA\u05D1 \u05E2\u05D1\u05E8\u05D9\u05EA" } addSample $w Hindi \ "\u0939\u093f\u0928\u094d\u0926\u0940 \u092d\u093e\u0937\u093e" addSample $w Icelandic "\u00CDslenska" addSample $w Japanese \ "\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, " \ "\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA" addSample $w Korean "\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00" addSample $w Russian \ "\u0420\u0443\u0441\u0441\u043A\u0438\u0439 \u044F\u0437\u044B\u043A" ## We're done processing, so change things back to normal running... destroy $w.wait $w conf -cursor $oldCursor
Save
cmd:
run