Bwidget Source Code
Hex Artifact Content
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Artifact e5d0d4d89721d9155c326e5f2b8239368afb372e:


0000: 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  # --------------
0010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0040: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0050: 0a 23 20 20 66 6f 6e 74 2e 74 63 6c 0a 23 20 20  .#  font.tcl.#  
0060: 54 68 69 73 20 66 69 6c 65 20 69 73 20 70 61 72  This file is par
0070: 74 20 6f 66 20 55 6e 69 66 69 78 20 42 57 69 64  t of Unifix BWid
0080: 67 65 74 20 54 6f 6f 6c 6b 69 74 0a 23 20 2d 2d  get Toolkit.# --
0090: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
00a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
00b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
00c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
00d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20  ------------.#  
00e0: 49 6e 64 65 78 20 6f 66 20 63 6f 6d 6d 61 6e 64  Index of command
00f0: 73 3a 0a 23 20 20 20 20 20 2d 20 53 65 6c 65 63  s:.#     - Selec
0100: 74 46 6f 6e 74 3a 3a 63 72 65 61 74 65 0a 23 20  tFont::create.# 
0110: 20 20 20 20 2d 20 53 65 6c 65 63 74 46 6f 6e 74      - SelectFont
0120: 3a 3a 63 6f 6e 66 69 67 75 72 65 0a 23 20 20 20  ::configure.#   
0130: 20 20 2d 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a    - SelectFont::
0140: 63 67 65 74 0a 23 20 20 20 20 20 2d 20 53 65 6c  cget.#     - Sel
0150: 65 63 74 46 6f 6e 74 3a 3a 5f 64 72 61 77 0a 23  ectFont::_draw.#
0160: 20 20 20 20 20 2d 20 53 65 6c 65 63 74 46 6f 6e       - SelectFon
0170: 74 3a 3a 5f 64 65 73 74 72 6f 79 0a 23 20 20 20  t::_destroy.#   
0180: 20 20 2d 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a    - SelectFont::
0190: 5f 6d 6f 64 73 74 79 6c 65 0a 23 20 20 20 20 20  _modstyle.#     
01a0: 2d 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f 75  - SelectFont::_u
01b0: 70 64 61 74 65 0a 23 20 20 20 20 20 2d 20 53 65  pdate.#     - Se
01c0: 6c 65 63 74 46 6f 6e 74 3a 3a 5f 67 65 74 66 6f  lectFont::_getfo
01d0: 6e 74 0a 23 20 20 20 20 20 2d 20 53 65 6c 65 63  nt.#     - Selec
01e0: 74 46 6f 6e 74 3a 3a 5f 69 6e 69 74 0a 23 20 2d  tFont::_init.# -
01f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0200: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0210: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0220: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0230: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 6e  -------------..n
0240: 61 6d 65 73 70 61 63 65 20 65 76 61 6c 20 53 65  amespace eval Se
0250: 6c 65 63 74 46 6f 6e 74 20 7b 0a 20 20 20 20 44  lectFont {.    D
0260: 69 61 6c 6f 67 3a 3a 75 73 65 0a 20 20 20 20 4c  ialog::use.    L
0270: 61 62 65 6c 46 72 61 6d 65 3a 3a 75 73 65 0a 20  abelFrame::use. 
0280: 20 20 20 53 63 72 6f 6c 6c 65 64 57 69 6e 64 6f     ScrolledWindo
0290: 77 3a 3a 75 73 65 0a 0a 20 20 20 20 57 69 64 67  w::use..    Widg
02a0: 65 74 3a 3a 64 65 63 6c 61 72 65 20 53 65 6c 65  et::declare Sele
02b0: 63 74 46 6f 6e 74 20 7b 0a 20 20 20 20 20 20 20  ctFont {.       
02c0: 20 7b 2d 74 69 74 6c 65 20 20 20 20 20 20 53 74   {-title      St
02d0: 72 69 6e 67 20 20 20 20 20 22 46 6f 6e 74 20 73  ring     "Font s
02e0: 65 6c 65 63 74 69 6f 6e 22 20 30 7d 0a 20 20 20  election" 0}.   
02f0: 20 20 20 20 20 7b 2d 70 61 72 65 6e 74 20 20 20       {-parent   
0300: 20 20 53 74 72 69 6e 67 20 20 20 20 20 22 22 20    String     "" 
0310: 30 7d 0a 20 20 20 20 20 20 20 20 7b 2d 62 61 63  0}.        {-bac
0320: 6b 67 72 6f 75 6e 64 20 54 6b 52 65 73 6f 75 72  kground TkResour
0330: 63 65 20 22 22 20 30 20 66 72 61 6d 65 7d 0a 0a  ce "" 0 frame}..
0340: 20 20 20 20 20 20 20 20 7b 2d 74 79 70 65 20 20          {-type  
0350: 20 20 20 20 20 45 6e 75 6d 20 20 20 20 20 20 20       Enum       
0360: 64 69 61 6c 6f 67 20 20 20 20 20 20 20 20 30 20  dialog        0 
0370: 7b 64 69 61 6c 6f 67 20 74 6f 6f 6c 62 61 72 7d  {dialog toolbar}
0380: 7d 0a 20 20 20 20 20 20 20 20 7b 2d 66 6f 6e 74  }.        {-font
0390: 20 20 20 20 20 20 20 54 6b 52 65 73 6f 75 72 63         TkResourc
03a0: 65 20 22 22 20 20 20 20 20 20 20 20 20 20 20 20  e ""            
03b0: 30 20 6c 61 62 65 6c 7d 0a 09 7b 2d 66 61 6d 69  0 label}..{-fami
03c0: 6c 69 65 73 20 20 20 53 74 72 69 6e 67 20 20 20  lies   String   
03d0: 20 20 22 61 6c 6c 22 20 20 20 20 20 20 20 20 20    "all"         
03e0: 31 7d 0a 09 7b 2d 73 74 79 6c 65 73 20 20 20 20  1}..{-styles    
03f0: 20 53 74 72 69 6e 67 20 20 20 20 20 22 62 6f 6c   String     "bol
0400: 64 20 69 74 61 6c 69 63 20 75 6e 64 65 72 6c 69  d italic underli
0410: 6e 65 20 6f 76 65 72 73 74 72 69 6b 65 22 20 31  ne overstrike" 1
0420: 7d 0a 20 20 20 20 20 20 20 20 7b 2d 63 6f 6d 6d  }.        {-comm
0430: 61 6e 64 20 20 20 20 53 74 72 69 6e 67 20 20 20  and    String   
0440: 20 20 22 22 20 20 20 20 20 20 20 20 20 20 20 20    ""            
0450: 30 7d 0a 20 20 20 20 20 20 20 20 7b 2d 73 61 6d  0}.        {-sam
0460: 70 6c 65 74 65 78 74 20 53 74 72 69 6e 67 20 20  pletext String  
0470: 20 20 20 22 53 61 6d 70 6c 65 20 54 65 78 74 22     "Sample Text"
0480: 20 30 7d 0a 20 20 20 20 20 20 20 20 7b 2d 62 67   0}.        {-bg
0490: 20 20 20 20 20 20 20 20 20 53 79 6e 6f 6e 79 6d           Synonym
04a0: 20 20 20 20 2d 62 61 63 6b 67 72 6f 75 6e 64 7d      -background}
04b0: 0a 20 20 20 20 7d 0a 0a 20 20 20 20 70 72 6f 63  .    }..    proc
04c0: 20 3a 3a 53 65 6c 65 63 74 46 6f 6e 74 20 7b 20   ::SelectFont { 
04d0: 70 61 74 68 20 61 72 67 73 20 7d 20 7b 20 72 65  path args } { re
04e0: 74 75 72 6e 20 5b 65 76 61 6c 20 53 65 6c 65 63  turn [eval Selec
04f0: 74 46 6f 6e 74 3a 3a 63 72 65 61 74 65 20 24 70  tFont::create $p
0500: 61 74 68 20 24 61 72 67 73 5d 20 7d 0a 20 20 20  ath $args] }.   
0510: 20 70 72 6f 63 20 75 73 65 20 7b 7d 20 7b 7d 0a   proc use {} {}.
0520: 0a 20 20 20 20 76 61 72 69 61 62 6c 65 20 5f 66  .    variable _f
0530: 61 6d 69 6c 69 65 73 0a 20 20 20 20 76 61 72 69  amilies.    vari
0540: 61 62 6c 65 20 5f 73 74 79 6c 65 4f 66 66 0a 20  able _styleOff. 
0550: 20 20 20 61 72 72 61 79 20 73 65 74 20 5f 73 74     array set _st
0560: 79 6c 65 4f 66 66 20 5b 6c 69 73 74 20 62 6f 6c  yleOff [list bol
0570: 64 20 6e 6f 72 6d 61 6c 20 69 74 61 6c 69 63 20  d normal italic 
0580: 72 6f 6d 61 6e 5d 0a 20 20 20 20 76 61 72 69 61  roman].    varia
0590: 62 6c 65 20 5f 73 69 7a 65 73 20 20 20 20 7b 34  ble _sizes    {4
05a0: 20 35 20 36 20 37 20 38 20 39 20 31 30 20 31 31   5 6 7 8 9 10 11
05b0: 20 31 32 20 31 33 20 31 34 20 31 35 20 31 36 20   12 13 14 15 16 
05c0: 31 37 20 31 38 20 31 39 20 32 30 20 32 31 20 32  17 18 19 20 21 2
05d0: 32 20 32 33 20 32 34 7d 0a 0a 20 20 20 20 76 61  2 23 24}..    va
05e0: 72 69 61 62 6c 65 20 5f 77 69 64 67 65 74 0a 7d  riable _widget.}
05f0: 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ...# -----------
0600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0610: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0620: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0630: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0640: 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 53  ---.#  Command S
0650: 65 6c 65 63 74 46 6f 6e 74 3a 3a 63 72 65 61 74  electFont::creat
0660: 65 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  e.# ------------
0670: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0680: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0690: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
06a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
06b0: 2d 2d 0a 70 72 6f 63 20 53 65 6c 65 63 74 46 6f  --.proc SelectFo
06c0: 6e 74 3a 3a 63 72 65 61 74 65 20 7b 20 70 61 74  nt::create { pat
06d0: 68 20 61 72 67 73 20 7d 20 7b 0a 20 20 20 20 76  h args } {.    v
06e0: 61 72 69 61 62 6c 65 20 5f 66 61 6d 69 6c 69 65  ariable _familie
06f0: 73 0a 20 20 20 20 76 61 72 69 61 62 6c 65 20 5f  s.    variable _
0700: 73 69 7a 65 73 0a 23 20 20 20 20 76 61 72 69 61  sizes.#    varia
0710: 62 6c 65 20 5f 73 74 79 6c 65 73 0a 20 20 20 20  ble _styles.    
0720: 76 61 72 69 61 62 6c 65 20 24 70 61 74 68 0a 20  variable $path. 
0730: 20 20 20 75 70 76 61 72 20 30 20 20 24 70 61 74     upvar 0  $pat
0740: 68 20 64 61 74 61 0a 0a 20 20 20 20 69 66 20 7b  h data..    if {
0750: 20 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 5f   ![info exists _
0760: 66 61 6d 69 6c 69 65 73 5d 20 7d 20 7b 0a 20 20  families] } {.  
0770: 20 20 20 20 20 20 6c 6f 61 64 66 6f 6e 74 0a 20        loadfont. 
0780: 20 20 20 7d 0a 20 20 20 20 57 69 64 67 65 74 3a     }.    Widget:
0790: 3a 69 6e 69 74 20 53 65 6c 65 63 74 46 6f 6e 74  :init SelectFont
07a0: 20 22 24 70 61 74 68 23 53 65 6c 65 63 74 46 6f   "$path#SelectFo
07b0: 6e 74 22 20 24 61 72 67 73 0a 20 20 20 20 73 65  nt" $args.    se
07c0: 74 20 62 67 20 5b 57 69 64 67 65 74 3a 3a 67 65  t bg [Widget::ge
07d0: 74 6f 70 74 69 6f 6e 20 22 24 70 61 74 68 23 53  toption "$path#S
07e0: 65 6c 65 63 74 46 6f 6e 74 22 20 2d 62 61 63 6b  electFont" -back
07f0: 67 72 6f 75 6e 64 5d 0a 20 20 20 20 73 65 74 20  ground].    set 
0800: 5f 73 74 79 6c 65 73 20 5b 57 69 64 67 65 74 3a  _styles [Widget:
0810: 3a 67 65 74 6f 70 74 69 6f 6e 20 22 24 70 61 74  :getoption "$pat
0820: 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 20 2d 73  h#SelectFont" -s
0830: 74 79 6c 65 73 5d 0a 20 20 20 20 69 66 20 7b 20  tyles].    if { 
0840: 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70 74 69  [Widget::getopti
0850: 6f 6e 20 22 24 70 61 74 68 23 53 65 6c 65 63 74  on "$path#Select
0860: 46 6f 6e 74 22 20 2d 74 79 70 65 5d 20 3d 3d 20  Font" -type] == 
0870: 22 64 69 61 6c 6f 67 22 20 7d 20 7b 0a 20 20 20  "dialog" } {.   
0880: 20 20 20 20 20 44 69 61 6c 6f 67 3a 3a 63 72 65       Dialog::cre
0890: 61 74 65 20 24 70 61 74 68 20 2d 6d 6f 64 61 6c  ate $path -modal
08a0: 20 6c 6f 63 61 6c 20 2d 64 65 66 61 75 6c 74 20   local -default 
08b0: 30 20 2d 63 61 6e 63 65 6c 20 31 20 2d 62 61 63  0 -cancel 1 -bac
08c0: 6b 67 72 6f 75 6e 64 20 24 62 67 20 5c 0a 20 20  kground $bg \.  
08d0: 20 20 20 20 20 20 20 20 20 20 2d 74 69 74 6c 65            -title
08e0: 20 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70    [Widget::getop
08f0: 74 69 6f 6e 20 22 24 70 61 74 68 23 53 65 6c 65  tion "$path#Sele
0900: 63 74 46 6f 6e 74 22 20 2d 74 69 74 6c 65 5d 20  ctFont" -title] 
0910: 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 2d 70  \.            -p
0920: 61 72 65 6e 74 20 5b 57 69 64 67 65 74 3a 3a 67  arent [Widget::g
0930: 65 74 6f 70 74 69 6f 6e 20 22 24 70 61 74 68 23  etoption "$path#
0940: 53 65 6c 65 63 74 46 6f 6e 74 22 20 2d 70 61 72  SelectFont" -par
0950: 65 6e 74 5d 0a 0a 20 20 20 20 20 20 20 20 73 65  ent]..        se
0960: 74 20 66 72 61 6d 65 20 5b 44 69 61 6c 6f 67 3a  t frame [Dialog:
0970: 3a 67 65 74 66 72 61 6d 65 20 24 70 61 74 68 5d  :getframe $path]
0980: 0a 20 20 20 20 20 20 20 20 73 65 74 20 74 6f 70  .        set top
0990: 66 20 20 5b 66 72 61 6d 65 20 24 66 72 61 6d 65  f  [frame $frame
09a0: 2e 74 6f 70 66 20 2d 72 65 6c 69 65 66 20 66 6c  .topf -relief fl
09b0: 61 74 20 2d 62 6f 72 64 65 72 77 69 64 74 68 20  at -borderwidth 
09c0: 30 20 2d 62 61 63 6b 67 72 6f 75 6e 64 20 24 62  0 -background $b
09d0: 67 5d 0a 0a 20 20 20 20 20 20 20 20 73 65 74 20  g]..        set 
09e0: 6c 61 62 66 31 20 5b 4c 61 62 65 6c 46 72 61 6d  labf1 [LabelFram
09f0: 65 3a 3a 63 72 65 61 74 65 20 24 74 6f 70 66 2e  e::create $topf.
0a00: 6c 61 62 66 31 20 2d 74 65 78 74 20 22 46 6f 6e  labf1 -text "Fon
0a10: 74 22 20 2d 6e 61 6d 65 20 66 6f 6e 74 20 5c 0a  t" -name font \.
0a20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0a30: 20 20 20 20 20 20 20 2d 73 69 64 65 20 74 6f 70         -side top
0a40: 20 2d 61 6e 63 68 6f 72 20 77 20 2d 72 65 6c 69   -anchor w -reli
0a50: 65 66 20 66 6c 61 74 20 2d 62 61 63 6b 67 72 6f  ef flat -backgro
0a60: 75 6e 64 20 24 62 67 5d 0a 20 20 20 20 20 20 20  und $bg].       
0a70: 20 73 65 74 20 73 77 20 20 20 20 5b 53 63 72 6f   set sw    [Scro
0a80: 6c 6c 65 64 57 69 6e 64 6f 77 3a 3a 63 72 65 61  lledWindow::crea
0a90: 74 65 20 5b 4c 61 62 65 6c 46 72 61 6d 65 3a 3a  te [LabelFrame::
0aa0: 67 65 74 66 72 61 6d 65 20 24 6c 61 62 66 31 5d  getframe $labf1]
0ab0: 2e 73 77 20 5c 0a 20 20 20 20 20 20 20 20 20 20  .sw \.          
0ac0: 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 62 61               -ba
0ad0: 63 6b 67 72 6f 75 6e 64 20 24 62 67 5d 0a 20 20  ckground $bg].  
0ae0: 20 20 20 20 20 20 73 65 74 20 6c 62 66 20 20 20        set lbf   
0af0: 5b 6c 69 73 74 62 6f 78 20 24 73 77 2e 6c 62 20  [listbox $sw.lb 
0b00: 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  \.              
0b10: 20 20 20 20 20 20 20 20 20 2d 68 65 69 67 68 74           -height
0b20: 20 35 20 2d 77 69 64 74 68 20 32 35 20 2d 65 78   5 -width 25 -ex
0b30: 70 6f 72 74 73 65 6c 65 63 74 69 6f 6e 20 66 61  portselection fa
0b40: 6c 73 65 20 2d 73 65 6c 65 63 74 6d 6f 64 65 20  lse -selectmode 
0b50: 62 72 6f 77 73 65 5d 0a 20 20 20 20 20 20 20 20  browse].        
0b60: 53 63 72 6f 6c 6c 65 64 57 69 6e 64 6f 77 3a 3a  ScrolledWindow::
0b70: 73 65 74 77 69 64 67 65 74 20 24 73 77 20 24 6c  setwidget $sw $l
0b80: 62 66 0a 20 20 20 20 20 20 20 20 4c 61 62 65 6c  bf.        Label
0b90: 46 72 61 6d 65 3a 3a 63 6f 6e 66 69 67 75 72 65  Frame::configure
0ba0: 20 24 6c 61 62 66 31 20 2d 66 6f 63 75 73 20 24   $labf1 -focus $
0bb0: 6c 62 66 0a 20 20 20 20 20 20 20 20 65 76 61 6c  lbf.        eval
0bc0: 20 24 6c 62 66 20 69 6e 73 65 72 74 20 65 6e 64   $lbf insert end
0bd0: 20 5c 0a 09 09 24 5f 66 61 6d 69 6c 69 65 73 28   \...$_families(
0be0: 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70 74 69  [Widget::getopti
0bf0: 6f 6e 20 22 24 70 61 74 68 23 53 65 6c 65 63 74  on "$path#Select
0c00: 46 6f 6e 74 22 20 2d 66 61 6d 69 6c 69 65 73 5d  Font" -families]
0c10: 29 0a 20 20 20 20 20 20 20 20 73 65 74 20 73 63  ).        set sc
0c20: 72 69 70 74 20 22 73 65 74 20 53 65 6c 65 63 74  ript "set Select
0c30: 46 6f 6e 74 3a 3a 24 70 61 74 68 5c 28 66 61 6d  Font::$path\(fam
0c40: 69 6c 79 5c 29 20 5c 5b 25 57 20 63 75 72 73 65  ily\) \[%W curse
0c50: 6c 65 63 74 69 6f 6e 5c 5d 3b 20 53 65 6c 65 63  lection\]; Selec
0c60: 74 46 6f 6e 74 3a 3a 5f 75 70 64 61 74 65 20 24  tFont::_update $
0c70: 70 61 74 68 22 0a 20 20 20 20 20 20 20 20 62 69  path".        bi
0c80: 6e 64 20 24 6c 62 66 20 3c 42 75 74 74 6f 6e 52  nd $lbf <ButtonR
0c90: 65 6c 65 61 73 65 2d 31 3e 20 24 73 63 72 69 70  elease-1> $scrip
0ca0: 74 0a 20 20 20 20 20 20 20 20 62 69 6e 64 20 24  t.        bind $
0cb0: 6c 62 66 20 3c 73 70 61 63 65 3e 20 20 20 20 20  lbf <space>     
0cc0: 20 20 20 20 20 20 24 73 63 72 69 70 74 0a 20 20        $script.  
0cd0: 20 20 20 20 20 20 70 61 63 6b 20 24 73 77 20 2d        pack $sw -
0ce0: 66 69 6c 6c 20 62 6f 74 68 20 2d 65 78 70 61 6e  fill both -expan
0cf0: 64 20 79 65 73 0a 0a 20 20 20 20 20 20 20 20 73  d yes..        s
0d00: 65 74 20 6c 61 62 66 32 20 5b 4c 61 62 65 6c 46  et labf2 [LabelF
0d10: 72 61 6d 65 3a 3a 63 72 65 61 74 65 20 24 74 6f  rame::create $to
0d20: 70 66 2e 6c 61 62 66 32 20 2d 74 65 78 74 20 22  pf.labf2 -text "
0d30: 53 69 7a 65 22 20 2d 6e 61 6d 65 20 73 69 7a 65  Size" -name size
0d40: 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20   \.             
0d50: 20 20 20 20 20 20 20 20 20 20 2d 73 69 64 65 20            -side 
0d60: 74 6f 70 20 2d 61 6e 63 68 6f 72 20 77 20 2d 72  top -anchor w -r
0d70: 65 6c 69 65 66 20 66 6c 61 74 20 2d 62 61 63 6b  elief flat -back
0d80: 67 72 6f 75 6e 64 20 24 62 67 5d 0a 20 20 20 20  ground $bg].    
0d90: 20 20 20 20 73 65 74 20 73 77 20 20 20 20 5b 53      set sw    [S
0da0: 63 72 6f 6c 6c 65 64 57 69 6e 64 6f 77 3a 3a 63  crolledWindow::c
0db0: 72 65 61 74 65 20 5b 4c 61 62 65 6c 46 72 61 6d  reate [LabelFram
0dc0: 65 3a 3a 67 65 74 66 72 61 6d 65 20 24 6c 61 62  e::getframe $lab
0dd0: 66 32 5d 2e 73 77 20 5c 0a 20 20 20 20 20 20 20  f2].sw \.       
0de0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0df0: 2d 73 63 72 6f 6c 6c 62 61 72 20 76 65 72 74 69  -scrollbar verti
0e00: 63 61 6c 20 2d 62 61 63 6b 67 72 6f 75 6e 64 20  cal -background 
0e10: 24 62 67 5d 0a 20 20 20 20 20 20 20 20 73 65 74  $bg].        set
0e20: 20 6c 62 73 20 20 20 5b 6c 69 73 74 62 6f 78 20   lbs   [listbox 
0e30: 24 73 77 2e 6c 62 20 5c 0a 20 20 20 20 20 20 20  $sw.lb \.       
0e40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0e50: 2d 68 65 69 67 68 74 20 35 20 2d 77 69 64 74 68  -height 5 -width
0e60: 20 36 20 2d 65 78 70 6f 72 74 73 65 6c 65 63 74   6 -exportselect
0e70: 69 6f 6e 20 66 61 6c 73 65 20 2d 73 65 6c 65 63  ion false -selec
0e80: 74 6d 6f 64 65 20 62 72 6f 77 73 65 5d 0a 20 20  tmode browse].  
0e90: 20 20 20 20 20 20 53 63 72 6f 6c 6c 65 64 57 69        ScrolledWi
0ea0: 6e 64 6f 77 3a 3a 73 65 74 77 69 64 67 65 74 20  ndow::setwidget 
0eb0: 24 73 77 20 24 6c 62 73 0a 20 20 20 20 20 20 20  $sw $lbs.       
0ec0: 20 4c 61 62 65 6c 46 72 61 6d 65 3a 3a 63 6f 6e   LabelFrame::con
0ed0: 66 69 67 75 72 65 20 24 6c 61 62 66 32 20 2d 66  figure $labf2 -f
0ee0: 6f 63 75 73 20 24 6c 62 73 0a 20 20 20 20 20 20  ocus $lbs.      
0ef0: 20 20 65 76 61 6c 20 24 6c 62 73 20 69 6e 73 65    eval $lbs inse
0f00: 72 74 20 65 6e 64 20 24 5f 73 69 7a 65 73 0a 20  rt end $_sizes. 
0f10: 20 20 20 20 20 20 20 73 65 74 20 73 63 72 69 70         set scrip
0f20: 74 20 22 73 65 74 20 53 65 6c 65 63 74 46 6f 6e  t "set SelectFon
0f30: 74 3a 3a 24 70 61 74 68 5c 28 73 69 7a 65 5c 29  t::$path\(size\)
0f40: 20 5c 5b 25 57 20 63 75 72 73 65 6c 65 63 74 69   \[%W curselecti
0f50: 6f 6e 5c 5d 3b 20 53 65 6c 65 63 74 46 6f 6e 74  on\]; SelectFont
0f60: 3a 3a 5f 75 70 64 61 74 65 20 24 70 61 74 68 22  ::_update $path"
0f70: 0a 20 20 20 20 20 20 20 20 62 69 6e 64 20 24 6c  .        bind $l
0f80: 62 73 20 3c 42 75 74 74 6f 6e 52 65 6c 65 61 73  bs <ButtonReleas
0f90: 65 2d 31 3e 20 24 73 63 72 69 70 74 0a 20 20 20  e-1> $script.   
0fa0: 20 20 20 20 20 62 69 6e 64 20 24 6c 62 73 20 3c       bind $lbs <
0fb0: 73 70 61 63 65 3e 20 20 20 20 20 20 20 20 20 20  space>          
0fc0: 20 24 73 63 72 69 70 74 0a 20 20 20 20 20 20 20   $script.       
0fd0: 20 70 61 63 6b 20 24 73 77 20 2d 66 69 6c 6c 20   pack $sw -fill 
0fe0: 62 6f 74 68 20 2d 65 78 70 61 6e 64 20 79 65 73  both -expand yes
0ff0: 0a 0a 20 20 20 20 20 20 20 20 73 65 74 20 6c 61  ..        set la
1000: 62 66 33 20 5b 4c 61 62 65 6c 46 72 61 6d 65 3a  bf3 [LabelFrame:
1010: 3a 63 72 65 61 74 65 20 24 74 6f 70 66 2e 6c 61  :create $topf.la
1020: 62 66 33 20 2d 74 65 78 74 20 22 53 74 79 6c 65  bf3 -text "Style
1030: 22 20 2d 6e 61 6d 65 20 73 74 79 6c 65 20 5c 0a  " -name style \.
1040: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1050: 20 20 20 20 20 20 20 2d 73 69 64 65 20 74 6f 70         -side top
1060: 20 2d 61 6e 63 68 6f 72 20 77 20 2d 72 65 6c 69   -anchor w -reli
1070: 65 66 20 73 75 6e 6b 65 6e 20 2d 62 64 20 31 20  ef sunken -bd 1 
1080: 2d 62 61 63 6b 67 72 6f 75 6e 64 20 24 62 67 5d  -background $bg]
1090: 0a 20 20 20 20 20 20 20 20 73 65 74 20 73 75 62  .        set sub
10a0: 66 20 20 5b 4c 61 62 65 6c 46 72 61 6d 65 3a 3a  f  [LabelFrame::
10b0: 67 65 74 66 72 61 6d 65 20 24 6c 61 62 66 33 5d  getframe $labf3]
10c0: 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68  .        foreach
10d0: 20 73 74 20 24 5f 73 74 79 6c 65 73 20 7b 0a 20   st $_styles {. 
10e0: 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 6e             set n
10f0: 61 6d 65 20 5b 6c 69 6e 64 65 78 20 5b 42 57 69  ame [lindex [BWi
1100: 64 67 65 74 3a 3a 67 65 74 6e 61 6d 65 20 24 73  dget::getname $s
1110: 74 5d 20 30 5d 0a 20 20 20 20 20 20 20 20 20 20  t] 0].          
1120: 20 20 69 66 20 7b 20 24 6e 61 6d 65 20 3d 3d 20    if { $name == 
1130: 22 22 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 20  "" } {.         
1140: 20 20 20 20 20 20 20 73 65 74 20 6e 61 6d 65 20         set name 
1150: 22 5b 73 74 72 69 6e 67 20 74 6f 75 70 70 65 72  "[string toupper
1160: 20 5b 73 74 72 69 6e 67 20 69 6e 64 65 78 20 24   [string index $
1170: 6e 61 6d 65 20 30 5d 5d 5b 73 74 72 69 6e 67 20  name 0]][string 
1180: 72 61 6e 67 65 20 24 6e 61 6d 65 20 31 20 65 6e  range $name 1 en
1190: 64 5d 22 0a 20 20 20 20 20 20 20 20 20 20 20 20  d]".            
11a0: 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 68  }.            ch
11b0: 65 63 6b 62 75 74 74 6f 6e 20 24 73 75 62 66 2e  eckbutton $subf.
11c0: 24 73 74 20 2d 74 65 78 74 20 24 6e 61 6d 65 20  $st -text $name 
11d0: 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  \.              
11e0: 20 20 2d 76 61 72 69 61 62 6c 65 20 20 20 53 65    -variable   Se
11f0: 6c 65 63 74 46 6f 6e 74 3a 3a 24 70 61 74 68 5c  lectFont::$path\
1200: 28 24 73 74 5c 29 20 5c 0a 20 20 20 20 20 20 20  ($st\) \.       
1210: 20 20 20 20 20 20 20 20 20 2d 62 61 63 6b 67 72           -backgr
1220: 6f 75 6e 64 20 24 62 67 20 5c 0a 20 20 20 20 20  ound $bg \.     
1230: 20 20 20 20 20 20 20 20 20 20 20 2d 63 6f 6d 6d             -comm
1240: 61 6e 64 20 20 20 20 22 53 65 6c 65 63 74 46 6f  and    "SelectFo
1250: 6e 74 3a 3a 5f 75 70 64 61 74 65 20 24 70 61 74  nt::_update $pat
1260: 68 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 62  h".            b
1270: 69 6e 64 20 24 73 75 62 66 2e 24 73 74 20 3c 52  ind $subf.$st <R
1280: 65 74 75 72 6e 3e 20 62 72 65 61 6b 0a 20 20 20  eturn> break.   
1290: 20 20 20 20 20 20 20 20 20 70 61 63 6b 20 24 73           pack $s
12a0: 75 62 66 2e 24 73 74 20 2d 61 6e 63 68 6f 72 20  ubf.$st -anchor 
12b0: 77 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20  w.        }.    
12c0: 20 20 20 20 4c 61 62 65 6c 46 72 61 6d 65 3a 3a      LabelFrame::
12d0: 63 6f 6e 66 69 67 75 72 65 20 24 6c 61 62 66 33  configure $labf3
12e0: 20 2d 66 6f 63 75 73 20 24 73 75 62 66 2e 5b 6c   -focus $subf.[l
12f0: 69 6e 64 65 78 20 24 5f 73 74 79 6c 65 73 20 30  index $_styles 0
1300: 5d 0a 0a 20 20 20 20 20 20 20 20 70 61 63 6b 20  ]..        pack 
1310: 24 6c 61 62 66 31 20 2d 73 69 64 65 20 6c 65 66  $labf1 -side lef
1320: 74 20 2d 61 6e 63 68 6f 72 20 6e 20 2d 66 69 6c  t -anchor n -fil
1330: 6c 20 62 6f 74 68 20 2d 65 78 70 61 6e 64 20 79  l both -expand y
1340: 65 73 0a 20 20 20 20 20 20 20 20 70 61 63 6b 20  es.        pack 
1350: 24 6c 61 62 66 32 20 2d 73 69 64 65 20 6c 65 66  $labf2 -side lef
1360: 74 20 2d 61 6e 63 68 6f 72 20 6e 20 2d 66 69 6c  t -anchor n -fil
1370: 6c 20 62 6f 74 68 20 2d 65 78 70 61 6e 64 20 79  l both -expand y
1380: 65 73 20 2d 70 61 64 78 20 38 0a 20 20 20 20 20  es -padx 8.     
1390: 20 20 20 70 61 63 6b 20 24 6c 61 62 66 33 20 2d     pack $labf3 -
13a0: 73 69 64 65 20 6c 65 66 74 20 2d 61 6e 63 68 6f  side left -ancho
13b0: 72 20 6e 20 2d 66 69 6c 6c 20 62 6f 74 68 20 2d  r n -fill both -
13c0: 65 78 70 61 6e 64 20 79 65 73 0a 0a 20 20 20 20  expand yes..    
13d0: 20 20 20 20 73 65 74 20 62 6f 74 66 20 5b 66 72      set botf [fr
13e0: 61 6d 65 20 24 66 72 61 6d 65 2e 62 6f 74 66 20  ame $frame.botf 
13f0: 2d 77 69 64 74 68 20 31 30 30 20 2d 68 65 69 67  -width 100 -heig
1400: 68 74 20 35 30 20 5c 0a 20 20 20 20 20 20 20 20  ht 50 \.        
1410: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 62                -b
1420: 67 20 77 68 69 74 65 20 2d 62 64 20 30 20 2d 72  g white -bd 0 -r
1430: 65 6c 69 65 66 20 66 6c 61 74 20 5c 0a 20 20 20  elief flat \.   
1440: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1450: 20 20 20 2d 68 69 67 68 6c 69 67 68 74 74 68 69     -highlightthi
1460: 63 6b 6e 65 73 73 20 31 20 2d 74 61 6b 65 66 6f  ckness 1 -takefo
1470: 63 75 73 20 30 20 5c 0a 20 20 20 20 20 20 20 20  cus 0 \.        
1480: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 68                -h
1490: 69 67 68 6c 69 67 68 74 62 61 63 6b 67 72 6f 75  ighlightbackgrou
14a0: 6e 64 20 62 6c 61 63 6b 20 5c 0a 20 20 20 20 20  nd black \.     
14b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
14c0: 20 2d 68 69 67 68 6c 69 67 68 74 63 6f 6c 6f 72   -highlightcolor
14d0: 20 62 6c 61 63 6b 5d 0a 0a 20 20 20 20 20 20 20   black]..       
14e0: 20 73 65 74 20 6c 61 62 20 20 5b 6c 61 62 65 6c   set lab  [label
14f0: 20 24 62 6f 74 66 2e 6c 61 62 65 6c 20 5c 0a 20   $botf.label \. 
1500: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1510: 20 20 20 20 20 2d 62 61 63 6b 67 72 6f 75 6e 64       -background
1520: 20 77 68 69 74 65 20 2d 66 6f 72 65 67 72 6f 75   white -foregrou
1530: 6e 64 20 62 6c 61 63 6b 20 5c 0a 20 20 20 20 20  nd black \.     
1540: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1550: 20 2d 62 6f 72 64 65 72 77 69 64 74 68 20 30 20   -borderwidth 0 
1560: 2d 74 61 6b 65 66 6f 63 75 73 20 30 20 2d 68 69  -takefocus 0 -hi
1570: 67 68 6c 69 67 68 74 74 68 69 63 6b 6e 65 73 73  ghlightthickness
1580: 20 30 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20   0 \.           
1590: 20 20 20 20 20 20 20 20 20 20 20 2d 74 65 78 74             -text
15a0: 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70 74   [Widget::getopt
15b0: 69 6f 6e 20 22 24 70 61 74 68 23 53 65 6c 65 63  ion "$path#Selec
15c0: 74 46 6f 6e 74 22 20 2d 73 61 6d 70 6c 65 74 65  tFont" -samplete
15d0: 78 74 5d 5d 0a 20 20 20 20 20 20 20 20 70 6c 61  xt]].        pla
15e0: 63 65 20 24 6c 61 62 20 2d 72 65 6c 78 20 30 2e  ce $lab -relx 0.
15f0: 35 20 2d 72 65 6c 79 20 30 2e 35 20 2d 61 6e 63  5 -rely 0.5 -anc
1600: 68 6f 72 20 63 0a 0a 20 20 20 20 20 20 20 20 70  hor c..        p
1610: 61 63 6b 20 24 74 6f 70 66 20 2d 70 61 64 79 20  ack $topf -pady 
1620: 34 20 2d 66 69 6c 6c 20 62 6f 74 68 20 2d 65 78  4 -fill both -ex
1630: 70 61 6e 64 20 79 65 73 0a 20 20 20 20 20 20 20  pand yes.       
1640: 20 70 61 63 6b 20 24 62 6f 74 66 20 2d 70 61 64   pack $botf -pad
1650: 79 20 34 20 2d 66 69 6c 6c 20 78 0a 0a 20 20 20  y 4 -fill x..   
1660: 20 20 20 20 20 44 69 61 6c 6f 67 3a 3a 61 64 64       Dialog::add
1670: 20 24 70 61 74 68 20 2d 6e 61 6d 65 20 6f 6b 0a   $path -name ok.
1680: 20 20 20 20 20 20 20 20 44 69 61 6c 6f 67 3a 3a          Dialog::
1690: 61 64 64 20 24 70 61 74 68 20 2d 6e 61 6d 65 20  add $path -name 
16a0: 63 61 6e 63 65 6c 0a 0a 20 20 20 20 20 20 20 20  cancel..        
16b0: 73 65 74 20 64 61 74 61 28 6c 61 62 65 6c 29 20  set data(label) 
16c0: 24 6c 61 62 0a 20 20 20 20 20 20 20 20 73 65 74  $lab.        set
16d0: 20 64 61 74 61 28 6c 62 66 29 20 20 20 24 6c 62   data(lbf)   $lb
16e0: 66 0a 20 20 20 20 20 20 20 20 73 65 74 20 64 61  f.        set da
16f0: 74 61 28 6c 62 73 29 20 20 20 24 6c 62 73 0a 0a  ta(lbs)   $lbs..
1700: 20 20 20 20 20 20 20 20 5f 67 65 74 66 6f 6e 74          _getfont
1710: 20 24 70 61 74 68 0a 0a 20 20 20 20 20 20 20 20   $path..        
1720: 70 72 6f 63 20 3a 3a 24 70 61 74 68 20 7b 20 63  proc ::$path { c
1730: 6d 64 20 61 72 67 73 20 7d 20 22 72 65 74 75 72  md args } "retur
1740: 6e 20 5c 5b 65 76 61 6c 20 53 65 6c 65 63 74 46  n \[eval SelectF
1750: 6f 6e 74 3a 3a 5c 24 63 6d 64 20 24 70 61 74 68  ont::\$cmd $path
1760: 20 5c 24 61 72 67 73 5c 5d 22 0a 0a 20 20 20 20   \$args\]"..    
1770: 20 20 20 20 72 65 74 75 72 6e 20 5b 5f 64 72 61      return [_dra
1780: 77 20 24 70 61 74 68 5d 0a 20 20 20 20 7d 20 65  w $path].    } e
1790: 6c 73 65 20 7b 0a 09 73 65 74 20 66 61 6d 73 20  lse {..set fams 
17a0: 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70 74 69  [Widget::getopti
17b0: 6f 6e 20 22 24 70 61 74 68 23 53 65 6c 65 63 74  on "$path#Select
17c0: 46 6f 6e 74 22 20 2d 66 61 6d 69 6c 69 65 73 5d  Font" -families]
17d0: 0a 20 20 20 20 20 20 20 20 66 72 61 6d 65 20 24  .        frame $
17e0: 70 61 74 68 20 2d 72 65 6c 69 65 66 20 66 6c 61  path -relief fla
17f0: 74 20 2d 62 6f 72 64 65 72 77 69 64 74 68 20 30  t -borderwidth 0
1800: 20 2d 62 61 63 6b 67 72 6f 75 6e 64 20 24 62 67   -background $bg
1810: 0a 20 20 20 20 20 20 20 20 62 69 6e 64 20 24 70  .        bind $p
1820: 61 74 68 20 3c 44 65 73 74 72 6f 79 3e 20 22 53  ath <Destroy> "S
1830: 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f 64 65 73 74  electFont::_dest
1840: 72 6f 79 20 24 70 61 74 68 22 0a 20 20 20 20 20  roy $path".     
1850: 20 20 20 73 65 74 20 6c 62 66 20 5b 43 6f 6d 62     set lbf [Comb
1860: 6f 42 6f 78 3a 3a 63 72 65 61 74 65 20 24 70 61  oBox::create $pa
1870: 74 68 2e 66 6f 6e 74 20 5c 0a 20 20 20 20 20 20  th.font \.      
1880: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d                 -
1890: 68 69 67 68 6c 69 67 68 74 74 68 69 63 6b 6e 65  highlightthickne
18a0: 73 73 20 30 20 2d 74 61 6b 65 66 6f 63 75 73 20  ss 0 -takefocus 
18b0: 30 20 2d 62 61 63 6b 67 72 6f 75 6e 64 20 24 62  0 -background $b
18c0: 67 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20  g \.            
18d0: 20 20 20 20 20 20 20 20 20 2d 76 61 6c 75 65 73           -values
18e0: 20 20 20 24 5f 66 61 6d 69 6c 69 65 73 28 24 66     $_families($f
18f0: 61 6d 73 29 20 5c 0a 20 20 20 20 20 20 20 20 20  ams) \.         
1900: 20 20 20 20 20 20 20 20 20 20 20 20 2d 74 65 78              -tex
1910: 74 76 61 72 69 61 62 6c 65 20 53 65 6c 65 63 74  tvariable Select
1920: 46 6f 6e 74 3a 3a 24 70 61 74 68 5c 28 66 61 6d  Font::$path\(fam
1930: 69 6c 79 5c 29 20 5c 0a 20 20 20 20 20 20 20 20  ily\) \.        
1940: 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 65 64               -ed
1950: 69 74 61 62 6c 65 20 30 20 5c 0a 20 20 20 20 20  itable 0 \.     
1960: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1970: 2d 6d 6f 64 69 66 79 63 6d 64 20 22 53 65 6c 65  -modifycmd "Sele
1980: 63 74 46 6f 6e 74 3a 3a 5f 75 70 64 61 74 65 20  ctFont::_update 
1990: 24 70 61 74 68 22 5d 0a 20 20 20 20 20 20 20 20  $path"].        
19a0: 73 65 74 20 6c 62 73 20 5b 43 6f 6d 62 6f 42 6f  set lbs [ComboBo
19b0: 78 3a 3a 63 72 65 61 74 65 20 24 70 61 74 68 2e  x::create $path.
19c0: 73 69 7a 65 20 5c 0a 20 20 20 20 20 20 20 20 20  size \.         
19d0: 20 20 20 20 20 20 20 20 20 20 20 20 2d 68 69 67              -hig
19e0: 68 6c 69 67 68 74 74 68 69 63 6b 6e 65 73 73 20  hlightthickness 
19f0: 30 20 2d 74 61 6b 65 66 6f 63 75 73 20 30 20 2d  0 -takefocus 0 -
1a00: 62 61 63 6b 67 72 6f 75 6e 64 20 24 62 67 20 5c  background $bg \
1a10: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
1a20: 20 20 20 20 20 20 2d 77 69 64 74 68 20 20 20 20        -width    
1a30: 34 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20  4 \.            
1a40: 20 20 20 20 20 20 20 20 20 2d 76 61 6c 75 65 73           -values
1a50: 20 20 20 24 5f 73 69 7a 65 73 20 5c 0a 20 20 20     $_sizes \.   
1a60: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1a70: 20 20 2d 74 65 78 74 76 61 72 69 61 62 6c 65 20    -textvariable 
1a80: 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 24 70 61 74  SelectFont::$pat
1a90: 68 5c 28 73 69 7a 65 5c 29 20 5c 0a 20 20 20 20  h\(size\) \.    
1aa0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1ab0: 20 2d 65 64 69 74 61 62 6c 65 20 30 20 5c 0a 20   -editable 0 \. 
1ac0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
1ad0: 20 20 20 20 2d 6d 6f 64 69 66 79 63 6d 64 20 22      -modifycmd "
1ae0: 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f 75 70 64  SelectFont::_upd
1af0: 61 74 65 20 24 70 61 74 68 22 5d 0a 20 20 20 20  ate $path"].    
1b00: 20 20 20 20 70 61 63 6b 20 24 6c 62 66 20 2d 73      pack $lbf -s
1b10: 69 64 65 20 6c 65 66 74 20 2d 61 6e 63 68 6f 72  ide left -anchor
1b20: 20 77 0a 20 20 20 20 20 20 20 20 70 61 63 6b 20   w.        pack 
1b30: 24 6c 62 73 20 2d 73 69 64 65 20 6c 65 66 74 20  $lbs -side left 
1b40: 2d 61 6e 63 68 6f 72 20 77 20 2d 70 61 64 78 20  -anchor w -padx 
1b50: 34 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63  4.        foreac
1b60: 68 20 73 74 20 24 5f 73 74 79 6c 65 73 20 7b 0a  h st $_styles {.
1b70: 20 20 20 20 20 20 20 20 20 20 20 20 62 75 74 74              butt
1b80: 6f 6e 20 24 70 61 74 68 2e 24 73 74 20 5c 0a 20  on $path.$st \. 
1b90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d                 -
1ba0: 68 69 67 68 6c 69 67 68 74 74 68 69 63 6b 6e 65  highlightthickne
1bb0: 73 73 20 30 20 2d 74 61 6b 65 66 6f 63 75 73 20  ss 0 -takefocus 
1bc0: 30 20 2d 70 61 64 78 20 30 20 2d 70 61 64 79 20  0 -padx 0 -pady 
1bd0: 30 20 2d 62 64 20 32 20 5c 0a 20 20 20 20 20 20  0 -bd 2 \.      
1be0: 20 20 20 20 20 20 20 20 20 20 2d 62 61 63 6b 67            -backg
1bf0: 72 6f 75 6e 64 20 24 62 67 20 5c 0a 20 20 20 20  round $bg \.    
1c00: 20 20 20 20 20 20 20 20 20 20 20 20 2d 69 6d 61              -ima
1c10: 67 65 20 20 5b 42 69 74 6d 61 70 3a 3a 67 65 74  ge  [Bitmap::get
1c20: 20 24 73 74 5d 20 5c 0a 20 20 20 20 20 20 20 20   $st] \.        
1c30: 20 20 20 20 20 20 20 20 2d 63 6f 6d 6d 61 6e 64          -command
1c40: 20 22 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f 6d   "SelectFont::_m
1c50: 6f 64 73 74 79 6c 65 20 24 70 61 74 68 20 24 73  odstyle $path $s
1c60: 74 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 70  t".            p
1c70: 61 63 6b 20 24 70 61 74 68 2e 24 73 74 20 2d 73  ack $path.$st -s
1c80: 69 64 65 20 6c 65 66 74 20 2d 61 6e 63 68 6f 72  ide left -anchor
1c90: 20 77 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20   w.        }.   
1ca0: 20 20 20 20 20 73 65 74 20 64 61 74 61 28 6c 61       set data(la
1cb0: 62 65 6c 29 20 22 22 0a 20 20 20 20 20 20 20 20  bel) "".        
1cc0: 73 65 74 20 64 61 74 61 28 6c 62 66 29 20 20 20  set data(lbf)   
1cd0: 24 6c 62 66 0a 20 20 20 20 20 20 20 20 73 65 74  $lbf.        set
1ce0: 20 64 61 74 61 28 6c 62 73 29 20 20 20 24 6c 62   data(lbs)   $lb
1cf0: 73 0a 20 20 20 20 20 20 20 20 5f 67 65 74 66 6f  s.        _getfo
1d00: 6e 74 20 24 70 61 74 68 0a 0a 20 20 20 20 20 20  nt $path..      
1d10: 20 20 72 65 6e 61 6d 65 20 24 70 61 74 68 20 3a    rename $path :
1d20: 3a 24 70 61 74 68 3a 63 6d 64 0a 20 20 20 20 20  :$path:cmd.     
1d30: 20 20 20 70 72 6f 63 20 3a 3a 24 70 61 74 68 20     proc ::$path 
1d40: 7b 20 63 6d 64 20 61 72 67 73 20 7d 20 22 72 65  { cmd args } "re
1d50: 74 75 72 6e 20 5c 5b 65 76 61 6c 20 53 65 6c 65  turn \[eval Sele
1d60: 63 74 46 6f 6e 74 3a 3a 5c 24 63 6d 64 20 24 70  ctFont::\$cmd $p
1d70: 61 74 68 20 5c 24 61 72 67 73 5c 5d 22 0a 20 20  ath \$args\]".  
1d80: 20 20 7d 0a 0a 20 20 20 20 72 65 74 75 72 6e 20    }..    return 
1d90: 24 70 61 74 68 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d  $path.}...# ----
1da0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1db0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1dc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1dd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1de0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f  ----------.#  Co
1df0: 6d 6d 61 6e 64 20 53 65 6c 65 63 74 46 6f 6e 74  mmand SelectFont
1e00: 3a 3a 63 6f 6e 66 69 67 75 72 65 0a 23 20 2d 2d  ::configure.# --
1e10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f  ------------.pro
1e60: 63 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 63 6f  c SelectFont::co
1e70: 6e 66 69 67 75 72 65 20 7b 20 70 61 74 68 20 61  nfigure { path a
1e80: 72 67 73 20 7d 20 7b 0a 23 20 20 20 20 76 61 72  rgs } {.#    var
1e90: 69 61 62 6c 65 20 5f 73 74 79 6c 65 73 0a 20 20  iable _styles.  
1ea0: 20 20 73 65 74 20 5f 73 74 79 6c 65 73 20 5b 57    set _styles [W
1eb0: 69 64 67 65 74 3a 3a 67 65 74 6f 70 74 69 6f 6e  idget::getoption
1ec0: 20 22 24 70 61 74 68 23 53 65 6c 65 63 74 46 6f   "$path#SelectFo
1ed0: 6e 74 22 20 2d 73 74 79 6c 65 73 5d 0a 0a 20 20  nt" -styles]..  
1ee0: 20 20 73 65 74 20 72 65 73 20 5b 57 69 64 67 65    set res [Widge
1ef0: 74 3a 3a 63 6f 6e 66 69 67 75 72 65 20 22 24 70  t::configure "$p
1f00: 61 74 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 20  ath#SelectFont" 
1f10: 24 61 72 67 73 5d 0a 0a 20 20 20 20 69 66 20 7b  $args]..    if {
1f20: 20 5b 57 69 64 67 65 74 3a 3a 68 61 73 43 68 61   [Widget::hasCha
1f30: 6e 67 65 64 20 22 24 70 61 74 68 23 53 65 6c 65  nged "$path#Sele
1f40: 63 74 46 6f 6e 74 22 20 2d 66 6f 6e 74 20 66 6f  ctFont" -font fo
1f50: 6e 74 5d 20 7d 20 7b 0a 20 20 20 20 20 20 20 20  nt] } {.        
1f60: 5f 67 65 74 66 6f 6e 74 20 24 70 61 74 68 0a 20  _getfont $path. 
1f70: 20 20 20 7d 0a 20 20 20 20 69 66 20 7b 20 5b 57     }.    if { [W
1f80: 69 64 67 65 74 3a 3a 68 61 73 43 68 61 6e 67 65  idget::hasChange
1f90: 64 20 22 24 70 61 74 68 23 53 65 6c 65 63 74 46  d "$path#SelectF
1fa0: 6f 6e 74 22 20 2d 62 61 63 6b 67 72 6f 75 6e 64  ont" -background
1fb0: 20 62 67 5d 20 7d 20 7b 0a 20 20 20 20 20 20 20   bg] } {.       
1fc0: 20 73 77 69 74 63 68 20 2d 2d 20 5b 57 69 64 67   switch -- [Widg
1fd0: 65 74 3a 3a 67 65 74 6f 70 74 69 6f 6e 20 22 24  et::getoption "$
1fe0: 70 61 74 68 23 53 65 6c 65 63 74 46 6f 6e 74 22  path#SelectFont"
1ff0: 20 2d 74 79 70 65 5d 20 7b 0a 20 20 20 20 20 20   -type] {.      
2000: 20 20 20 20 20 20 64 69 61 6c 6f 67 20 7b 0a 20        dialog {. 
2010: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 44                 D
2020: 69 61 6c 6f 67 3a 3a 63 6f 6e 66 69 67 75 72 65  ialog::configure
2030: 20 24 70 61 74 68 20 2d 62 61 63 6b 67 72 6f 75   $path -backgrou
2040: 6e 64 20 24 62 67 0a 20 20 20 20 20 20 20 20 20  nd $bg.         
2050: 20 20 20 20 20 20 20 73 65 74 20 74 6f 70 66 20         set topf 
2060: 5b 44 69 61 6c 6f 67 3a 3a 67 65 74 66 72 61 6d  [Dialog::getfram
2070: 65 20 24 70 61 74 68 5d 2e 74 6f 70 66 0a 20 20  e $path].topf.  
2080: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74                $t
2090: 6f 70 66 20 63 6f 6e 66 69 67 75 72 65 20 2d 62  opf configure -b
20a0: 61 63 6b 67 72 6f 75 6e 64 20 24 62 67 0a 20 20  ackground $bg.  
20b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 6f                fo
20c0: 72 65 61 63 68 20 6c 61 62 66 20 7b 6c 61 62 66  reach labf {labf
20d0: 31 20 6c 61 62 66 32 7d 20 7b 0a 20 20 20 20 20  1 labf2} {.     
20e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4c                 L
20f0: 61 62 65 6c 46 72 61 6d 65 3a 3a 63 6f 6e 66 69  abelFrame::confi
2100: 67 75 72 65 20 24 74 6f 70 66 2e 24 6c 61 62 66  gure $topf.$labf
2110: 20 2d 62 61 63 6b 67 72 6f 75 6e 64 20 24 62 67   -background $bg
2120: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
2130: 20 20 20 20 20 73 65 74 20 73 75 62 66 20 5b 4c       set subf [L
2140: 61 62 65 6c 46 72 61 6d 65 3a 3a 67 65 74 66 72  abelFrame::getfr
2150: 61 6d 65 20 24 74 6f 70 66 2e 24 6c 61 62 66 5d  ame $topf.$labf]
2160: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
2170: 20 20 20 20 20 53 63 72 6f 6c 6c 65 64 57 69 6e       ScrolledWin
2180: 64 6f 77 3a 3a 63 6f 6e 66 69 67 75 72 65 20 24  dow::configure $
2190: 73 75 62 66 2e 73 77 20 2d 62 61 63 6b 67 72 6f  subf.sw -backgro
21a0: 75 6e 64 20 24 62 67 0a 20 20 20 20 20 20 20 20  und $bg.        
21b0: 20 20 20 20 20 20 20 20 20 20 20 20 24 73 75 62              $sub
21c0: 66 2e 73 77 2e 6c 62 20 63 6f 6e 66 69 67 75 72  f.sw.lb configur
21d0: 65 20 2d 62 61 63 6b 67 72 6f 75 6e 64 20 24 62  e -background $b
21e0: 67 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  g.              
21f0: 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20    }.            
2200: 20 20 20 20 4c 61 62 65 6c 46 72 61 6d 65 3a 3a      LabelFrame::
2210: 63 6f 6e 66 69 67 75 72 65 20 24 74 6f 70 66 2e  configure $topf.
2220: 6c 61 62 66 33 20 2d 62 61 63 6b 67 72 6f 75 6e  labf3 -backgroun
2230: 64 20 24 62 67 0a 20 20 20 20 20 20 20 20 20 20  d $bg.          
2240: 20 20 20 20 20 20 73 65 74 20 73 75 62 66 20 5b        set subf [
2250: 4c 61 62 65 6c 46 72 61 6d 65 3a 3a 67 65 74 66  LabelFrame::getf
2260: 72 61 6d 65 20 24 74 6f 70 66 2e 6c 61 62 66 33  rame $topf.labf3
2270: 5d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ].              
2280: 20 20 66 6f 72 65 61 63 68 20 77 20 5b 77 69 6e    foreach w [win
2290: 66 6f 20 63 68 69 6c 64 72 65 6e 20 24 73 75 62  fo children $sub
22a0: 66 5d 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20  f] {.           
22b0: 20 20 20 20 20 20 20 20 20 24 77 20 63 6f 6e 66           $w conf
22c0: 69 67 75 72 65 20 2d 62 61 63 6b 67 72 6f 75 6e  igure -backgroun
22d0: 64 20 24 62 67 0a 20 20 20 20 20 20 20 20 20 20  d $bg.          
22e0: 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20        }.        
22f0: 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20      }.          
2300: 20 20 74 6f 6f 6c 62 61 72 20 7b 0a 20 20 20 20    toolbar {.    
2310: 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61 74              $pat
2320: 68 20 63 6f 6e 66 69 67 75 72 65 20 2d 62 61 63  h configure -bac
2330: 6b 67 72 6f 75 6e 64 20 24 62 67 0a 20 20 20 20  kground $bg.    
2340: 20 20 20 20 20 20 20 20 20 20 20 20 43 6f 6d 62              Comb
2350: 6f 42 6f 78 3a 3a 63 6f 6e 66 69 67 75 72 65 20  oBox::configure 
2360: 24 70 61 74 68 2e 66 6f 6e 74 20 2d 62 61 63 6b  $path.font -back
2370: 67 72 6f 75 6e 64 20 24 62 67 0a 20 20 20 20 20  ground $bg.     
2380: 20 20 20 20 20 20 20 20 20 20 20 43 6f 6d 62 6f             Combo
2390: 42 6f 78 3a 3a 63 6f 6e 66 69 67 75 72 65 20 24  Box::configure $
23a0: 70 61 74 68 2e 73 69 7a 65 20 2d 62 61 63 6b 67  path.size -backg
23b0: 72 6f 75 6e 64 20 24 62 67 0a 20 20 20 20 20 20  round $bg.      
23c0: 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63            foreac
23d0: 68 20 73 74 20 24 5f 73 74 79 6c 65 73 20 7b 0a  h st $_styles {.
23e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
23f0: 20 20 20 20 24 70 61 74 68 2e 24 73 74 20 63 6f      $path.$st co
2400: 6e 66 69 67 75 72 65 20 2d 62 61 63 6b 67 72 6f  nfigure -backgro
2410: 75 6e 64 20 24 62 67 0a 20 20 20 20 20 20 20 20  und $bg.        
2420: 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20          }.      
2430: 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20        }.        
2440: 7d 0a 20 20 20 20 7d 0a 20 20 20 20 72 65 74 75  }.    }.    retu
2450: 72 6e 20 24 72 65 73 0a 7d 0a 0a 0a 23 20 2d 2d  rn $res.}...# --
2460: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2470: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2480: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2490: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
24a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20  ------------.#  
24b0: 43 6f 6d 6d 61 6e 64 20 53 65 6c 65 63 74 46 6f  Command SelectFo
24c0: 6e 74 3a 3a 63 67 65 74 0a 23 20 2d 2d 2d 2d 2d  nt::cget.# -----
24d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
24e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
24f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2500: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2510: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 53  ---------.proc S
2520: 65 6c 65 63 74 46 6f 6e 74 3a 3a 63 67 65 74 20  electFont::cget 
2530: 7b 20 70 61 74 68 20 6f 70 74 69 6f 6e 20 7d 20  { path option } 
2540: 7b 0a 20 20 20 20 72 65 74 75 72 6e 20 5b 57 69  {.    return [Wi
2550: 64 67 65 74 3a 3a 63 67 65 74 20 22 24 70 61 74  dget::cget "$pat
2560: 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 20 24 6f  h#SelectFont" $o
2570: 70 74 69 6f 6e 5d 0a 7d 0a 0a 0a 23 20 2d 2d 2d  ption].}...# ---
2580: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2590: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
25a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
25b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
25c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 43  -----------.#  C
25d0: 6f 6d 6d 61 6e 64 20 53 65 6c 65 63 74 46 6f 6e  ommand SelectFon
25e0: 74 3a 3a 6c 6f 61 64 66 6f 6e 74 0a 23 20 2d 2d  t::loadfont.# --
25f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2610: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2620: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2630: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f  ------------.pro
2640: 63 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 6c 6f  c SelectFont::lo
2650: 61 64 66 6f 6e 74 20 7b 20 7d 20 7b 0a 20 20 20  adfont { } {.   
2660: 20 76 61 72 69 61 62 6c 65 20 5f 66 61 6d 69 6c   variable _famil
2670: 69 65 73 0a 0a 20 20 20 20 23 20 69 6e 69 74 69  ies..    # initi
2680: 61 6c 69 7a 65 20 66 61 6d 69 6c 69 65 73 0a 20  alize families. 
2690: 20 20 20 73 65 74 20 5f 66 61 6d 69 6c 69 65 73     set _families
26a0: 28 61 6c 6c 29 20 7b 7d 0a 20 20 20 20 73 65 74  (all) {}.    set
26b0: 20 5f 66 61 6d 69 6c 69 65 73 28 66 69 78 65 64   _families(fixed
26c0: 29 20 7b 7d 0a 20 20 20 20 73 65 74 20 5f 66 61  ) {}.    set _fa
26d0: 6d 69 6c 69 65 73 28 76 61 72 69 61 62 6c 65 29  milies(variable)
26e0: 20 7b 7d 0a 20 20 20 20 73 65 74 20 6c 66 6f 6e   {}.    set lfon
26f0: 74 20 20 20 20 20 5b 66 6f 6e 74 20 66 61 6d 69  t     [font fami
2700: 6c 69 65 73 5d 0a 20 20 20 20 6c 61 70 70 65 6e  lies].    lappen
2710: 64 20 6c 66 6f 6e 74 20 74 69 6d 65 73 20 63 6f  d lfont times co
2720: 75 72 69 65 72 20 68 65 6c 76 65 74 69 63 61 0a  urier helvetica.
2730: 20 20 20 20 66 6f 72 65 61 63 68 20 66 6f 6e 74      foreach font
2740: 20 24 6c 66 6f 6e 74 20 7b 0a 20 20 20 20 20 20   $lfont {.      
2750: 20 20 73 65 74 20 66 61 6d 69 6c 79 20 5b 66 6f    set family [fo
2760: 6e 74 20 61 63 74 75 61 6c 20 5b 6c 69 73 74 20  nt actual [list 
2770: 24 66 6f 6e 74 5d 20 2d 66 61 6d 69 6c 79 5d 0a  $font] -family].
2780: 20 20 20 20 20 20 20 20 69 66 20 7b 20 5b 6c 73          if { [ls
2790: 65 61 72 63 68 20 2d 65 78 61 63 74 20 24 5f 66  earch -exact $_f
27a0: 61 6d 69 6c 69 65 73 28 61 6c 6c 29 20 24 66 61  amilies(all) $fa
27b0: 6d 69 6c 79 5d 20 3d 3d 20 2d 31 20 7d 20 7b 0a  mily] == -1 } {.
27c0: 20 20 20 20 20 20 20 20 20 20 20 20 6c 61 70 70              lapp
27d0: 65 6e 64 20 5f 66 61 6d 69 6c 69 65 73 28 61 6c  end _families(al
27e0: 6c 29 20 24 66 61 6d 69 6c 79 0a 20 20 20 20 20  l) $family.     
27f0: 20 20 20 7d 0a 20 20 20 20 7d 0a 20 20 20 20 73     }.    }.    s
2800: 65 74 20 5f 66 61 6d 69 6c 69 65 73 28 61 6c 6c  et _families(all
2810: 29 20 5b 6c 73 6f 72 74 20 24 5f 66 61 6d 69 6c  ) [lsort $_famil
2820: 69 65 73 28 61 6c 6c 29 5d 0a 20 20 20 20 66 6f  ies(all)].    fo
2830: 72 65 61 63 68 20 66 61 6d 69 6c 79 20 24 5f 66  reach family $_f
2840: 61 6d 69 6c 69 65 73 28 61 6c 6c 29 20 7b 0a 09  amilies(all) {..
2850: 69 66 20 7b 20 5b 66 6f 6e 74 20 6d 65 74 72 69  if { [font metri
2860: 63 73 20 5b 6c 69 73 74 20 24 66 61 6d 69 6c 79  cs [list $family
2870: 5d 20 2d 66 69 78 65 64 5d 20 7d 20 7b 0a 09 20  ] -fixed] } {.. 
2880: 20 20 20 6c 61 70 70 65 6e 64 20 5f 66 61 6d 69     lappend _fami
2890: 6c 69 65 73 28 66 69 78 65 64 29 20 24 66 61 6d  lies(fixed) $fam
28a0: 69 6c 79 0a 09 7d 20 65 6c 73 65 20 7b 0a 09 20  ily..} else {.. 
28b0: 20 20 20 6c 61 70 70 65 6e 64 20 5f 66 61 6d 69     lappend _fami
28c0: 6c 69 65 73 28 76 61 72 69 61 62 6c 65 29 20 24  lies(variable) $
28d0: 66 61 6d 69 6c 79 0a 09 7d 0a 20 20 20 20 7d 0a  family..}.    }.
28e0: 20 20 20 20 72 65 74 75 72 6e 0a 7d 0a 0a 0a 23      return.}...#
28f0: 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   ---------------
2900: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2910: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2920: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2930: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a  ---------------.
2940: 23 20 20 43 6f 6d 6d 61 6e 64 20 53 65 6c 65 63  #  Command Selec
2950: 74 46 6f 6e 74 3a 3a 5f 64 72 61 77 0a 23 20 2d  tFont::_draw.# -
2960: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2970: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2980: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2990: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
29a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72  -------------.pr
29b0: 6f 63 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f  oc SelectFont::_
29c0: 64 72 61 77 20 7b 20 70 61 74 68 20 7d 20 7b 0a  draw { path } {.
29d0: 20 20 20 20 76 61 72 69 61 62 6c 65 20 24 70 61      variable $pa
29e0: 74 68 0a 20 20 20 20 75 70 76 61 72 20 30 20 20  th.    upvar 0  
29f0: 24 70 61 74 68 20 64 61 74 61 0a 0a 20 20 20 20  $path data..    
2a00: 24 64 61 74 61 28 6c 62 66 29 20 73 65 6c 65 63  $data(lbf) selec
2a10: 74 69 6f 6e 20 63 6c 65 61 72 20 30 20 65 6e 64  tion clear 0 end
2a20: 0a 20 20 20 20 24 64 61 74 61 28 6c 62 66 29 20  .    $data(lbf) 
2a30: 73 65 6c 65 63 74 69 6f 6e 20 73 65 74 20 24 64  selection set $d
2a40: 61 74 61 28 66 61 6d 69 6c 79 29 0a 20 20 20 20  ata(family).    
2a50: 24 64 61 74 61 28 6c 62 66 29 20 61 63 74 69 76  $data(lbf) activ
2a60: 61 74 65 20 24 64 61 74 61 28 66 61 6d 69 6c 79  ate $data(family
2a70: 29 0a 20 20 20 20 24 64 61 74 61 28 6c 62 66 29  ).    $data(lbf)
2a80: 20 73 65 65 20 24 64 61 74 61 28 66 61 6d 69 6c   see $data(famil
2a90: 79 29 0a 20 20 20 20 24 64 61 74 61 28 6c 62 73  y).    $data(lbs
2aa0: 29 20 73 65 6c 65 63 74 69 6f 6e 20 63 6c 65 61  ) selection clea
2ab0: 72 20 30 20 65 6e 64 0a 20 20 20 20 24 64 61 74  r 0 end.    $dat
2ac0: 61 28 6c 62 73 29 20 73 65 6c 65 63 74 69 6f 6e  a(lbs) selection
2ad0: 20 73 65 74 20 24 64 61 74 61 28 73 69 7a 65 29   set $data(size)
2ae0: 0a 20 20 20 20 24 64 61 74 61 28 6c 62 73 29 20  .    $data(lbs) 
2af0: 61 63 74 69 76 61 74 65 20 24 64 61 74 61 28 73  activate $data(s
2b00: 69 7a 65 29 0a 20 20 20 20 24 64 61 74 61 28 6c  ize).    $data(l
2b10: 62 73 29 20 73 65 65 20 24 64 61 74 61 28 73 69  bs) see $data(si
2b20: 7a 65 29 0a 20 20 20 20 5f 75 70 64 61 74 65 20  ze).    _update 
2b30: 24 70 61 74 68 0a 0a 20 20 20 20 69 66 20 7b 20  $path..    if { 
2b40: 5b 44 69 61 6c 6f 67 3a 3a 64 72 61 77 20 24 70  [Dialog::draw $p
2b50: 61 74 68 5d 20 3d 3d 20 30 20 7d 20 7b 0a 20 20  ath] == 0 } {.  
2b60: 20 20 20 20 20 20 73 65 74 20 72 65 73 75 6c 74        set result
2b70: 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70 74   [Widget::getopt
2b80: 69 6f 6e 20 22 24 70 61 74 68 23 53 65 6c 65 63  ion "$path#Selec
2b90: 74 46 6f 6e 74 22 20 2d 66 6f 6e 74 5d 0a 20 20  tFont" -font].  
2ba0: 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20    } else {.     
2bb0: 20 20 20 73 65 74 20 72 65 73 75 6c 74 20 22 22     set result ""
2bc0: 0a 20 20 20 20 7d 0a 20 20 20 20 75 6e 73 65 74  .    }.    unset
2bd0: 20 64 61 74 61 0a 20 20 20 20 57 69 64 67 65 74   data.    Widget
2be0: 3a 3a 64 65 73 74 72 6f 79 20 22 24 70 61 74 68  ::destroy "$path
2bf0: 23 53 65 6c 65 63 74 46 6f 6e 74 22 0a 20 20 20  #SelectFont".   
2c00: 20 64 65 73 74 72 6f 79 20 24 70 61 74 68 0a 20   destroy $path. 
2c10: 20 20 20 72 65 74 75 72 6e 20 24 72 65 73 75 6c     return $resul
2c20: 74 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d  t.}...# --------
2c30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2c70: 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e  ------.#  Comman
2c80: 64 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f 64  d SelectFont::_d
2c90: 65 73 74 72 6f 79 0a 23 20 2d 2d 2d 2d 2d 2d 2d  estroy.# -------
2ca0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2cb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2cc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2cd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2ce0: 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 53 65 6c  -------.proc Sel
2cf0: 65 63 74 46 6f 6e 74 3a 3a 5f 64 65 73 74 72 6f  ectFont::_destro
2d00: 79 20 7b 20 70 61 74 68 20 7d 20 7b 0a 20 20 20  y { path } {.   
2d10: 20 76 61 72 69 61 62 6c 65 20 24 70 61 74 68 0a   variable $path.
2d20: 20 20 20 20 75 70 76 61 72 20 30 20 20 24 70 61      upvar 0  $pa
2d30: 74 68 20 64 61 74 61 0a 0a 20 20 20 20 75 6e 73  th data..    uns
2d40: 65 74 20 64 61 74 61 0a 20 20 20 20 57 69 64 67  et data.    Widg
2d50: 65 74 3a 3a 64 65 73 74 72 6f 79 20 22 24 70 61  et::destroy "$pa
2d60: 74 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 0a 20  th#SelectFont". 
2d70: 20 20 20 72 65 6e 61 6d 65 20 24 70 61 74 68 20     rename $path 
2d80: 7b 7d 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d  {}.}...# -------
2d90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2da0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2db0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2dc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2dd0: 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61  -------.#  Comma
2de0: 6e 64 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f  nd SelectFont::_
2df0: 6d 6f 64 73 74 79 6c 65 0a 23 20 2d 2d 2d 2d 2d  modstyle.# -----
2e00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2e10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2e20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2e30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2e40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 53  ---------.proc S
2e50: 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f 6d 6f 64 73  electFont::_mods
2e60: 74 79 6c 65 20 7b 20 70 61 74 68 20 73 74 79 6c  tyle { path styl
2e70: 65 20 7d 20 7b 0a 20 20 20 20 76 61 72 69 61 62  e } {.    variab
2e80: 6c 65 20 24 70 61 74 68 0a 20 20 20 20 75 70 76  le $path.    upv
2e90: 61 72 20 30 20 20 24 70 61 74 68 20 64 61 74 61  ar 0  $path data
2ea0: 0a 0a 20 20 20 20 69 66 20 7b 20 24 64 61 74 61  ..    if { $data
2eb0: 28 24 73 74 79 6c 65 29 20 3d 3d 20 31 20 7d 20  ($style) == 1 } 
2ec0: 7b 0a 20 20 20 20 20 20 20 20 24 70 61 74 68 2e  {.        $path.
2ed0: 24 73 74 79 6c 65 20 63 6f 6e 66 69 67 75 72 65  $style configure
2ee0: 20 2d 72 65 6c 69 65 66 20 72 61 69 73 65 64 0a   -relief raised.
2ef0: 20 20 20 20 20 20 20 20 73 65 74 20 64 61 74 61          set data
2f00: 28 24 73 74 79 6c 65 29 20 30 0a 20 20 20 20 7d  ($style) 0.    }
2f10: 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20   else {.        
2f20: 24 70 61 74 68 2e 24 73 74 79 6c 65 20 63 6f 6e  $path.$style con
2f30: 66 69 67 75 72 65 20 2d 72 65 6c 69 65 66 20 73  figure -relief s
2f40: 75 6e 6b 65 6e 0a 20 20 20 20 20 20 20 20 73 65  unken.        se
2f50: 74 20 64 61 74 61 28 24 73 74 79 6c 65 29 20 31  t data($style) 1
2f60: 0a 20 20 20 20 7d 0a 20 20 20 20 5f 75 70 64 61  .    }.    _upda
2f70: 74 65 20 24 70 61 74 68 0a 7d 0a 0a 0a 23 20 2d  te $path.}...# -
2f80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2f90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2fa0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2fb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2fc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
2fd0: 20 43 6f 6d 6d 61 6e 64 20 53 65 6c 65 63 74 46   Command SelectF
2fe0: 6f 6e 74 3a 3a 5f 75 70 64 61 74 65 0a 23 20 2d  ont::_update.# -
2ff0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3000: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3010: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3020: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3030: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72  -------------.pr
3040: 6f 63 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f  oc SelectFont::_
3050: 75 70 64 61 74 65 20 7b 20 70 61 74 68 20 7d 20  update { path } 
3060: 7b 0a 20 20 20 20 76 61 72 69 61 62 6c 65 20 5f  {.    variable _
3070: 66 61 6d 69 6c 69 65 73 0a 20 20 20 20 76 61 72  families.    var
3080: 69 61 62 6c 65 20 5f 73 69 7a 65 73 0a 20 20 20  iable _sizes.   
3090: 20 76 61 72 69 61 62 6c 65 20 5f 73 74 79 6c 65   variable _style
30a0: 4f 66 66 0a 20 20 20 20 76 61 72 69 61 62 6c 65  Off.    variable
30b0: 20 24 70 61 74 68 0a 20 20 20 20 75 70 76 61 72   $path.    upvar
30c0: 20 30 20 20 24 70 61 74 68 20 64 61 74 61 0a 0a   0  $path data..
30d0: 20 20 20 20 73 65 74 20 74 79 70 65 20 5b 57 69      set type [Wi
30e0: 64 67 65 74 3a 3a 67 65 74 6f 70 74 69 6f 6e 20  dget::getoption 
30f0: 22 24 70 61 74 68 23 53 65 6c 65 63 74 46 6f 6e  "$path#SelectFon
3100: 74 22 20 2d 74 79 70 65 5d 0a 20 20 20 20 73 65  t" -type].    se
3110: 74 20 66 61 6d 73 20 5b 57 69 64 67 65 74 3a 3a  t fams [Widget::
3120: 67 65 74 6f 70 74 69 6f 6e 20 22 24 70 61 74 68  getoption "$path
3130: 23 53 65 6c 65 63 74 46 6f 6e 74 22 20 2d 66 61  #SelectFont" -fa
3140: 6d 69 6c 69 65 73 5d 0a 20 20 20 20 73 65 74 20  milies].    set 
3150: 5f 73 74 79 6c 65 73 20 5b 57 69 64 67 65 74 3a  _styles [Widget:
3160: 3a 67 65 74 6f 70 74 69 6f 6e 20 22 24 70 61 74  :getoption "$pat
3170: 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 20 2d 73  h#SelectFont" -s
3180: 74 79 6c 65 73 5d 0a 20 20 20 20 69 66 20 7b 20  tyles].    if { 
3190: 24 74 79 70 65 20 3d 3d 20 22 64 69 61 6c 6f 67  $type == "dialog
31a0: 22 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 73 65  " } {.        se
31b0: 74 20 63 75 72 73 20 5b 24 70 61 74 68 3a 63 6d  t curs [$path:cm
31c0: 64 20 63 67 65 74 20 2d 63 75 72 73 6f 72 5d 0a  d cget -cursor].
31d0: 20 20 20 20 20 20 20 20 24 70 61 74 68 3a 63 6d          $path:cm
31e0: 64 20 63 6f 6e 66 69 67 75 72 65 20 2d 63 75 72  d configure -cur
31f0: 73 6f 72 20 77 61 74 63 68 0a 20 20 20 20 7d 0a  sor watch.    }.
3200: 20 20 20 20 69 66 20 7b 20 5b 57 69 64 67 65 74      if { [Widget
3210: 3a 3a 67 65 74 6f 70 74 69 6f 6e 20 22 24 70 61  ::getoption "$pa
3220: 74 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 20 2d  th#SelectFont" -
3230: 74 79 70 65 5d 20 3d 3d 20 22 64 69 61 6c 6f 67  type] == "dialog
3240: 22 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 73 65  " } {.        se
3250: 74 20 66 6f 6e 74 20 5b 6c 69 73 74 20 5c 0a 20  t font [list \. 
3260: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
3270: 20 20 20 20 20 5b 6c 69 6e 64 65 78 20 24 5f 66       [lindex $_f
3280: 61 6d 69 6c 69 65 73 28 24 66 61 6d 73 29 20 24  amilies($fams) $
3290: 64 61 74 61 28 66 61 6d 69 6c 79 29 5d 20 5c 0a  data(family)] \.
32a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
32b0: 20 20 20 20 20 20 5b 6c 69 6e 64 65 78 20 24 5f        [lindex $_
32c0: 73 69 7a 65 73 20 24 64 61 74 61 28 73 69 7a 65  sizes $data(size
32d0: 29 5d 5d 0a 20 20 20 20 7d 20 65 6c 73 65 20 7b  )]].    } else {
32e0: 0a 20 20 20 20 20 20 20 20 73 65 74 20 66 6f 6e  .        set fon
32f0: 74 20 5b 6c 69 73 74 20 24 64 61 74 61 28 66 61  t [list $data(fa
3300: 6d 69 6c 79 29 20 24 64 61 74 61 28 73 69 7a 65  mily) $data(size
3310: 29 5d 0a 20 20 20 20 7d 0a 20 20 20 20 66 6f 72  )].    }.    for
3320: 65 61 63 68 20 73 74 20 24 5f 73 74 79 6c 65 73  each st $_styles
3330: 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 7b 20   {.        if { 
3340: 24 64 61 74 61 28 24 73 74 29 20 7d 20 7b 0a 20  $data($st) } {. 
3350: 20 20 20 20 20 20 20 20 20 20 20 6c 61 70 70 65             lappe
3360: 6e 64 20 66 6f 6e 74 20 24 73 74 0a 20 20 20 20  nd font $st.    
3370: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 09 20 20      } else {..  
3380: 20 20 69 66 20 7b 20 5b 69 6e 66 6f 20 65 78 69    if { [info exi
3390: 73 74 73 20 5f 73 74 79 6c 65 4f 66 66 28 24 73  sts _styleOff($s
33a0: 74 29 5d 20 7d 20 7b 0a 09 09 6c 61 70 70 65 6e  t)] } {...lappen
33b0: 64 20 66 6f 6e 74 20 24 5f 73 74 79 6c 65 4f 66  d font $_styleOf
33c0: 66 28 24 73 74 29 0a 09 20 20 20 20 7d 0a 09 7d  f($st)..    }..}
33d0: 0a 20 20 20 20 7d 0a 20 20 20 20 57 69 64 67 65  .    }.    Widge
33e0: 74 3a 3a 73 65 74 6f 70 74 69 6f 6e 20 22 24 70  t::setoption "$p
33f0: 61 74 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 20  ath#SelectFont" 
3400: 2d 66 6f 6e 74 20 24 66 6f 6e 74 0a 20 20 20 20  -font $font.    
3410: 69 66 20 7b 20 24 74 79 70 65 20 3d 3d 20 22 64  if { $type == "d
3420: 69 61 6c 6f 67 22 20 7d 20 7b 0a 20 20 20 20 20  ialog" } {.     
3430: 20 20 20 24 64 61 74 61 28 6c 61 62 65 6c 29 20     $data(label) 
3440: 63 6f 6e 66 69 67 75 72 65 20 2d 66 6f 6e 74 20  configure -font 
3450: 24 66 6f 6e 74 0a 20 20 20 20 20 20 20 20 24 70  $font.        $p
3460: 61 74 68 3a 63 6d 64 20 63 6f 6e 66 69 67 75 72  ath:cmd configur
3470: 65 20 2d 63 75 72 73 6f 72 20 24 63 75 72 73 0a  e -cursor $curs.
3480: 20 20 20 20 7d 20 65 6c 73 65 69 66 20 7b 20 5b      } elseif { [
3490: 73 65 74 20 63 6d 64 20 5b 57 69 64 67 65 74 3a  set cmd [Widget:
34a0: 3a 67 65 74 6f 70 74 69 6f 6e 20 22 24 70 61 74  :getoption "$pat
34b0: 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 20 2d 63  h#SelectFont" -c
34c0: 6f 6d 6d 61 6e 64 5d 5d 20 21 3d 20 22 22 20 7d  ommand]] != "" }
34d0: 20 7b 0a 20 20 20 20 20 20 20 20 75 70 6c 65 76   {.        uplev
34e0: 65 6c 20 5c 23 30 20 24 63 6d 64 0a 20 20 20 20  el \#0 $cmd.    
34f0: 7d 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d  }.}...# --------
3500: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3510: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3520: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3530: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3540: 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e  ------.#  Comman
3550: 64 20 53 65 6c 65 63 74 46 6f 6e 74 3a 3a 5f 67  d SelectFont::_g
3560: 65 74 66 6f 6e 74 0a 23 20 2d 2d 2d 2d 2d 2d 2d  etfont.# -------
3570: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3580: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3590: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
35a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
35b0: 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 53 65 6c  -------.proc Sel
35c0: 65 63 74 46 6f 6e 74 3a 3a 5f 67 65 74 66 6f 6e  ectFont::_getfon
35d0: 74 20 7b 20 70 61 74 68 20 7d 20 7b 0a 20 20 20  t { path } {.   
35e0: 20 76 61 72 69 61 62 6c 65 20 5f 66 61 6d 69 6c   variable _famil
35f0: 69 65 73 0a 23 20 20 20 20 76 61 72 69 61 62 6c  ies.#    variabl
3600: 65 20 5f 73 74 79 6c 65 73 0a 20 20 20 20 76 61  e _styles.    va
3610: 72 69 61 62 6c 65 20 5f 73 69 7a 65 73 0a 20 20  riable _sizes.  
3620: 20 20 76 61 72 69 61 62 6c 65 20 24 70 61 74 68    variable $path
3630: 0a 20 20 20 20 75 70 76 61 72 20 30 20 20 24 70  .    upvar 0  $p
3640: 61 74 68 20 64 61 74 61 0a 0a 20 20 20 20 61 72  ath data..    ar
3650: 72 61 79 20 73 65 74 20 66 6f 6e 74 20 5b 66 6f  ray set font [fo
3660: 6e 74 20 61 63 74 75 61 6c 20 5b 57 69 64 67 65  nt actual [Widge
3670: 74 3a 3a 67 65 74 6f 70 74 69 6f 6e 20 22 24 70  t::getoption "$p
3680: 61 74 68 23 53 65 6c 65 63 74 46 6f 6e 74 22 20  ath#SelectFont" 
3690: 2d 66 6f 6e 74 5d 5d 0a 20 20 20 20 73 65 74 20  -font]].    set 
36a0: 64 61 74 61 28 62 6f 6c 64 29 20 20 20 20 20 20  data(bold)      
36b0: 20 5b 65 78 70 72 20 7b 5b 73 74 72 69 6e 67 20   [expr {[string 
36c0: 63 6f 6d 70 61 72 65 20 24 66 6f 6e 74 28 2d 77  compare $font(-w
36d0: 65 69 67 68 74 29 20 22 6e 6f 72 6d 61 6c 22 5d  eight) "normal"]
36e0: 20 21 3d 20 30 7d 5d 0a 20 20 20 20 73 65 74 20   != 0}].    set 
36f0: 64 61 74 61 28 69 74 61 6c 69 63 29 20 20 20 20  data(italic)    
3700: 20 5b 65 78 70 72 20 7b 5b 73 74 72 69 6e 67 20   [expr {[string 
3710: 63 6f 6d 70 61 72 65 20 24 66 6f 6e 74 28 2d 73  compare $font(-s
3720: 6c 61 6e 74 29 20 20 22 72 6f 6d 61 6e 22 5d 20  lant)  "roman"] 
3730: 20 21 3d 20 30 7d 5d 0a 20 20 20 20 73 65 74 20   != 0}].    set 
3740: 64 61 74 61 28 75 6e 64 65 72 6c 69 6e 65 29 20  data(underline) 
3750: 20 24 66 6f 6e 74 28 2d 75 6e 64 65 72 6c 69 6e   $font(-underlin
3760: 65 29 0a 20 20 20 20 73 65 74 20 64 61 74 61 28  e).    set data(
3770: 6f 76 65 72 73 74 72 69 6b 65 29 20 24 66 6f 6e  overstrike) $fon
3780: 74 28 2d 6f 76 65 72 73 74 72 69 6b 65 29 0a 20  t(-overstrike). 
3790: 20 20 20 73 65 74 20 5f 73 74 79 6c 65 73 20 5b     set _styles [
37a0: 57 69 64 67 65 74 3a 3a 67 65 74 6f 70 74 69 6f  Widget::getoptio
37b0: 6e 20 22 24 70 61 74 68 23 53 65 6c 65 63 74 46  n "$path#SelectF
37c0: 6f 6e 74 22 20 2d 73 74 79 6c 65 73 5d 0a 20 20  ont" -styles].  
37d0: 20 20 73 65 74 20 66 61 6d 73 20 5b 57 69 64 67    set fams [Widg
37e0: 65 74 3a 3a 67 65 74 6f 70 74 69 6f 6e 20 22 24  et::getoption "$
37f0: 70 61 74 68 23 53 65 6c 65 63 74 46 6f 6e 74 22  path#SelectFont"
3800: 20 2d 66 61 6d 69 6c 69 65 73 5d 0a 20 20 20 20   -families].    
3810: 69 66 20 7b 20 5b 57 69 64 67 65 74 3a 3a 67 65  if { [Widget::ge
3820: 74 6f 70 74 69 6f 6e 20 22 24 70 61 74 68 23 53  toption "$path#S
3830: 65 6c 65 63 74 46 6f 6e 74 22 20 2d 74 79 70 65  electFont" -type
3840: 5d 20 3d 3d 20 22 64 69 61 6c 6f 67 22 20 7d 20  ] == "dialog" } 
3850: 7b 0a 20 20 20 20 20 20 20 20 73 65 74 20 69 64  {.        set id
3860: 78 66 20 5b 6c 73 65 61 72 63 68 20 24 5f 66 61  xf [lsearch $_fa
3870: 6d 69 6c 69 65 73 28 24 66 61 6d 73 29 20 24 66  milies($fams) $f
3880: 6f 6e 74 28 2d 66 61 6d 69 6c 79 29 5d 0a 20 20  ont(-family)].  
3890: 20 20 20 20 20 20 73 65 74 20 69 64 78 73 20 5b        set idxs [
38a0: 6c 73 65 61 72 63 68 20 24 5f 73 69 7a 65 73 20  lsearch $_sizes 
38b0: 20 20 20 24 66 6f 6e 74 28 2d 73 69 7a 65 29 5d     $font(-size)]
38c0: 0a 20 20 20 20 20 20 20 20 73 65 74 20 64 61 74  .        set dat
38d0: 61 28 66 61 6d 69 6c 79 29 20 5b 65 78 70 72 20  a(family) [expr 
38e0: 7b 24 69 64 78 66 20 3e 3d 20 30 20 3f 20 24 69  {$idxf >= 0 ? $i
38f0: 64 78 66 20 3a 20 30 7d 5d 0a 20 20 20 20 20 20  dxf : 0}].      
3900: 20 20 73 65 74 20 64 61 74 61 28 73 69 7a 65 29    set data(size)
3910: 20 20 20 5b 65 78 70 72 20 7b 24 69 64 78 73 20     [expr {$idxs 
3920: 3e 3d 20 30 20 3f 20 24 69 64 78 73 20 3a 20 30  >= 0 ? $idxs : 0
3930: 7d 5d 0a 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a  }].    } else {.
3940: 20 20 20 20 20 20 20 20 73 65 74 20 64 61 74 61          set data
3950: 28 66 61 6d 69 6c 79 29 20 24 66 6f 6e 74 28 2d  (family) $font(-
3960: 66 61 6d 69 6c 79 29 0a 20 20 20 20 20 20 20 20  family).        
3970: 73 65 74 20 64 61 74 61 28 73 69 7a 65 29 20 20  set data(size)  
3980: 20 24 66 6f 6e 74 28 2d 73 69 7a 65 29 0a 20 20   $font(-size).  
3990: 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 73 74        foreach st
39a0: 20 24 5f 73 74 79 6c 65 73 20 7b 0a 20 20 20 20   $_styles {.    
39b0: 20 20 20 20 20 20 20 20 24 70 61 74 68 2e 24 73          $path.$s
39c0: 74 20 63 6f 6e 66 69 67 75 72 65 20 2d 72 65 6c  t configure -rel
39d0: 69 65 66 20 5b 65 78 70 72 20 7b 24 64 61 74 61  ief [expr {$data
39e0: 28 24 73 74 29 20 3f 20 22 73 75 6e 6b 65 6e 22  ($st) ? "sunken"
39f0: 3a 22 72 61 69 73 65 64 22 7d 5d 0a 20 20 20 20  :"raised"}].    
3a00: 20 20 20 20 7d 0a 20 20 20 20 7d 0a 7d 0a 0a         }.    }.}..