source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/lib/linux/tk8.4/demos/unicodeout.tcl @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.7 KB
Line 
1# unicodeout.tcl --
2#
3# This demonstration script shows how you can produce output (in label
4# widgets) using many different alphabets.
5#
6# RCS: @(#) $Id: unicodeout.tcl,v 1.2 2003/02/21 13:05:06 dkf Exp $
7
8if {![info exists widgetDemo]} {
9    error "This script should be run from the \"widget\" demo."
10}
11
12set w .unicodeout
13catch {destroy $w}
14toplevel $w
15wm title $w "Unicode Label Demonstration"
16wm iconname $w "unicodeout"
17positionWindow $w
18
19label $w.msg -font $font -wraplength 4i -justify left \
20        -text "This is a sample of Tk's support for languages that use\
21        non-Western character sets.  However, what you will actually see\
22        below depends largely on what character sets you have installed,\
23        and what you see for characters that are not present varies greatly\
24        between platforms as well.  The strings are written in Tcl using\
25        UNICODE characters using the \\uXXXX escape so as to do so in a\
26        portable fashion."
27pack $w.msg -side top
28
29frame $w.buttons
30pack $w.buttons -side bottom -fill x -pady 2m
31button $w.buttons.dismiss -text Dismiss -command "destroy $w"
32button $w.buttons.code -text "See Code" -command "showCode $w"
33pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
34
35pack [label $w.wait -text "Please wait while loading fonts..." \
36        -font {Helvetica 12 italic}]
37pack [frame $w.f] -expand 1 -fill both -padx 2m -pady 1m
38grid columnconfigure $w.f 1 -weight 1
39
40set i 0
41proc addSample {w language args} {
42    global font i
43    set sample [join $args ""]
44    set j [incr i]
45    label $w.f.l$j -font $font -text "${language}:" -anchor nw -pady 0
46    label $w.f.s$j -font $font -text $sample -anchor nw -width 30 -pady 0
47    grid $w.f.l$j $w.f.s$j -sticky ew -pady 0
48    grid configure $w.f.l$j -padx 1m
49}
50
51# Processing when some characters are missing might take a while, so make
52# sure we're displaying something in the meantime...
53
54set oldCursor [$w cget -cursor]
55$w conf -cursor watch
56update
57
58addSample $w Arabic \
59         "\uFE94\uFEF4\uFE91\uFEAE\uFECC\uFEDF\uFE8D\uFE94" \
60         "\uFEE4\uFEE0\uFEDC\uFEDF\uFE8D"
61addSample $w "Trad. Chinese" "\u4E2D\u570B\u7684\u6F22\u5B57"
62addSample $w "Simpl. Chinese" "\u6C49\u8BED"
63addSample $w Greek \
64         "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE " \
65         "\u03B3\u03BB\u03CE\u03C3\u03C3\u03B1"
66addSample $w Hebrew \
67         "\u05DD\u05D9\u05DC\u05E9\u05D5\u05E8\u05D9 " \
68         "\u05DC\u05D9\u05D0\u05E8\u05E9\u05D9"
69addSample $w Japanese \
70         "\u65E5\u672C\u8A9E\u306E\u3072\u3089\u304C\u306A, " \
71         "\u6F22\u5B57\u3068\u30AB\u30BF\u30AB\u30CA"
72addSample $w Korean "\uB300\uD55C\uBBFC\uAD6D\uC758 \uD55C\uAE00"
73addSample $w Russian \
74        "\u0420\u0443\u0441\u0441\u043A\u0438\u0439 \u044F\u0437\u044B\u043A"
75
76# We're done processing, so change things back to normal running...
77destroy $w.wait
78$w conf -cursor $oldCursor
Note: See TracBrowser for help on using the repository browser.