Bwidget Source Code
Hex Artifact Content
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

Artifact a8297a3f6df0824b7157d311af3cd98b52e4a495:


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 0a 23  --------------.#
0050: 20 20 62 75 74 74 6f 6e 2e 74 63 6c 0a 23 20 20    button.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 0a 23 20 20 49 6e  ----------.#  In
00e0: 64 65 78 20 6f 66 20 63 6f 6d 6d 61 6e 64 73 3a  dex of commands:
00f0: 0a 23 20 20 20 50 75 62 6c 69 63 20 63 6f 6d 6d  .#   Public comm
0100: 61 6e 64 73 0a 23 20 20 20 20 20 2d 20 42 75 74  ands.#     - But
0110: 74 6f 6e 3a 3a 63 72 65 61 74 65 0a 23 20 20 20  ton::create.#   
0120: 20 20 2d 20 42 75 74 74 6f 6e 3a 3a 63 6f 6e 66    - Button::conf
0130: 69 67 75 72 65 0a 23 20 20 20 20 20 2d 20 42 75  igure.#     - Bu
0140: 74 74 6f 6e 3a 3a 63 67 65 74 0a 23 20 20 20 20  tton::cget.#    
0150: 20 2d 20 42 75 74 74 6f 6e 3a 3a 69 6e 76 6f 6b   - Button::invok
0160: 65 0a 23 20 20 20 50 72 69 76 61 74 65 20 63 6f  e.#   Private co
0170: 6d 6d 61 6e 64 73 20 28 65 76 65 6e 74 20 62 69  mmands (event bi
0180: 6e 64 69 6e 67 73 29 0a 23 20 20 20 20 20 2d 20  ndings).#     - 
0190: 42 75 74 74 6f 6e 3a 3a 5f 64 65 73 74 72 6f 79  Button::_destroy
01a0: 0a 23 20 20 20 20 20 2d 20 42 75 74 74 6f 6e 3a  .#     - Button:
01b0: 3a 5f 65 6e 74 65 72 0a 23 20 20 20 20 20 2d 20  :_enter.#     - 
01c0: 42 75 74 74 6f 6e 3a 3a 5f 6c 65 61 76 65 0a 23  Button::_leave.#
01d0: 20 20 20 20 20 2d 20 42 75 74 74 6f 6e 3a 3a 5f       - Button::_
01e0: 70 72 65 73 73 0a 23 20 20 20 20 20 2d 20 42 75  press.#     - Bu
01f0: 74 74 6f 6e 3a 3a 5f 72 65 6c 65 61 73 65 0a 23  tton::_release.#
0200: 20 20 20 20 20 2d 20 42 75 74 74 6f 6e 3a 3a 5f       - Button::_
0210: 72 65 70 65 61 74 0a 23 20 2d 2d 2d 2d 2d 2d 2d  repeat.# -------
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 2d 2d 2d  ----------------
0240: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0250: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0260: 2d 2d 2d 2d 2d 0a 0a 6e 61 6d 65 73 70 61 63 65  -----..namespace
0270: 20 65 76 61 6c 20 42 75 74 74 6f 6e 20 7b 0a 20   eval Button {. 
0280: 20 20 20 57 69 64 67 65 74 3a 3a 64 65 66 69 6e     Widget::defin
0290: 65 20 42 75 74 74 6f 6e 20 62 75 74 74 6f 6e 20  e Button button 
02a0: 44 79 6e 61 6d 69 63 48 65 6c 70 0a 0a 20 20 20  DynamicHelp..   
02b0: 20 73 65 74 20 72 65 6d 6f 76 65 20 5b 6c 69 73   set remove [lis
02c0: 74 20 2d 63 6f 6d 6d 61 6e 64 20 2d 72 65 6c 69  t -command -reli
02d0: 65 66 20 2d 74 65 78 74 20 2d 74 65 78 74 76 61  ef -text -textva
02e0: 72 69 61 62 6c 65 20 2d 75 6e 64 65 72 6c 69 6e  riable -underlin
02f0: 65 20 2d 73 74 61 74 65 5d 0a 20 20 20 20 69 66  e -state].    if
0300: 20 7b 5b 69 6e 66 6f 20 74 63 6c 76 65 72 73 69   {[info tclversi
0310: 6f 6e 5d 20 3e 20 38 2e 33 7d 20 7b 0a 09 6c 61  on] > 8.3} {..la
0320: 70 70 65 6e 64 20 72 65 6d 6f 76 65 20 2d 72 65  ppend remove -re
0330: 70 65 61 74 64 65 6c 61 79 20 2d 72 65 70 65 61  peatdelay -repea
0340: 74 69 6e 74 65 72 76 61 6c 0a 20 20 20 20 7d 0a  tinterval.    }.
0350: 20 20 20 20 69 66 20 7b 24 3a 3a 57 69 64 67 65      if {$::Widge
0360: 74 3a 3a 5f 74 68 65 6d 65 7d 20 7b 0a 20 20 20  t::_theme} {.   
0370: 20 20 20 20 20 6c 61 70 70 65 6e 64 20 72 65 6d       lappend rem
0380: 6f 76 65 20 2d 61 63 74 69 76 65 62 61 63 6b 67  ove -activebackg
0390: 72 6f 75 6e 64 20 2d 61 63 74 69 76 65 66 6f 72  round -activefor
03a0: 65 67 72 6f 75 6e 64 20 2d 61 6e 63 68 6f 72 20  eground -anchor 
03b0: 2d 62 61 63 6b 67 72 6f 75 6e 64 5c 0a 20 20 20  -background\.   
03c0: 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 62 69               -bi
03d0: 74 6d 61 70 20 2d 62 6f 72 64 65 72 77 69 64 74  tmap -borderwidt
03e0: 68 20 2d 64 69 73 61 62 6c 65 64 66 6f 72 65 67  h -disabledforeg
03f0: 72 6f 75 6e 64 20 2d 66 6f 6e 74 20 2d 66 6f 72  round -font -for
0400: 65 67 72 6f 75 6e 64 5c 0a 20 20 20 20 20 20 20  eground\.       
0410: 20 20 20 20 20 20 20 20 20 2d 68 65 69 67 68 74           -height
0420: 20 2d 68 69 67 68 6c 69 67 68 74 62 61 63 6b 67   -highlightbackg
0430: 72 6f 75 6e 64 20 2d 68 69 67 68 6c 69 67 68 74  round -highlight
0440: 63 6f 6c 6f 72 20 2d 68 69 67 68 6c 69 67 68 74  color -highlight
0450: 74 68 69 63 6b 6e 65 73 73 5c 0a 20 20 20 20 20  thickness\.     
0460: 20 20 20 20 20 20 20 20 20 20 20 2d 6a 75 73 74             -just
0470: 69 66 79 20 2d 6f 76 65 72 72 65 6c 69 65 66 20  ify -overrelief 
0480: 2d 70 61 64 78 20 2d 70 61 64 79 20 2d 72 65 6c  -padx -pady -rel
0490: 69 65 66 20 2d 77 72 61 70 6c 65 6e 67 74 68 0a  ief -wraplength.
04a0: 20 20 20 20 7d 0a 20 20 20 20 57 69 64 67 65 74      }.    Widget
04b0: 3a 3a 74 6b 69 6e 63 6c 75 64 65 20 42 75 74 74  ::tkinclude Butt
04c0: 6f 6e 20 62 75 74 74 6f 6e 20 3a 63 6d 64 20 72  on button :cmd r
04d0: 65 6d 6f 76 65 20 24 72 65 6d 6f 76 65 0a 0a 20  emove $remove.. 
04e0: 20 20 20 57 69 64 67 65 74 3a 3a 64 65 63 6c 61     Widget::decla
04f0: 72 65 20 42 75 74 74 6f 6e 20 7b 0a 20 20 20 20  re Button {.    
0500: 20 20 20 20 7b 2d 6e 61 6d 65 20 20 20 20 20 20      {-name      
0510: 20 20 20 20 20 20 53 74 72 69 6e 67 20 22 22 20        String "" 
0520: 30 7d 0a 20 20 20 20 20 20 20 20 7b 2d 74 65 78  0}.        {-tex
0530: 74 20 20 20 20 20 20 20 20 20 20 20 20 53 74 72  t            Str
0540: 69 6e 67 20 22 22 20 30 7d 0a 20 20 20 20 20 20  ing "" 0}.      
0550: 20 20 7b 2d 74 65 78 74 76 61 72 69 61 62 6c 65    {-textvariable
0560: 20 20 20 20 53 74 72 69 6e 67 20 22 22 20 30 7d      String "" 0}
0570: 0a 20 20 20 20 20 20 20 20 7b 2d 75 6e 64 65 72  .        {-under
0580: 6c 69 6e 65 20 20 20 20 20 20 20 49 6e 74 20 20  line       Int  
0590: 20 20 2d 31 20 30 20 22 25 64 20 3e 3d 20 2d 31    -1 0 "%d >= -1
05a0: 22 7d 0a 20 20 20 20 20 20 20 20 7b 2d 61 72 6d  "}.        {-arm
05b0: 63 6f 6d 6d 61 6e 64 20 20 20 20 20 20 53 74 72  command      Str
05c0: 69 6e 67 20 22 22 20 30 7d 0a 20 20 20 20 20 20  ing "" 0}.      
05d0: 20 20 7b 2d 64 69 73 61 72 6d 63 6f 6d 6d 61 6e    {-disarmcomman
05e0: 64 20 20 20 53 74 72 69 6e 67 20 22 22 20 30 7d  d   String "" 0}
05f0: 0a 20 20 20 20 20 20 20 20 7b 2d 63 6f 6d 6d 61  .        {-comma
0600: 6e 64 20 20 20 20 20 20 20 20 20 53 74 72 69 6e  nd         Strin
0610: 67 20 22 22 20 30 7d 0a 20 20 20 20 20 20 20 20  g "" 0}.        
0620: 7b 2d 73 74 61 74 65 20 20 20 20 20 20 20 20 20  {-state         
0630: 20 20 54 6b 52 65 73 6f 75 72 63 65 20 22 22 20    TkResource "" 
0640: 30 20 62 75 74 74 6f 6e 7d 0a 20 20 20 20 20 20  0 button}.      
0650: 20 20 7b 2d 72 65 70 65 61 74 64 65 6c 61 79 20    {-repeatdelay 
0660: 20 20 20 20 49 6e 74 20 20 20 20 30 20 20 30 20      Int    0  0 
0670: 22 25 64 20 3e 3d 20 30 22 7d 0a 20 20 20 20 20  "%d >= 0"}.     
0680: 20 20 20 7b 2d 72 65 70 65 61 74 69 6e 74 65 72     {-repeatinter
0690: 76 61 6c 20 20 49 6e 74 20 20 20 20 30 20 20 30  val  Int    0  0
06a0: 20 22 25 64 20 3e 3d 20 30 22 7d 0a 20 20 20 20   "%d >= 0"}.    
06b0: 20 20 20 20 7b 2d 72 65 6c 69 65 66 20 20 20 20      {-relief    
06c0: 20 20 20 20 20 20 45 6e 75 6d 20 20 20 72 61 69        Enum   rai
06d0: 73 65 64 20 20 30 20 7b 72 61 69 73 65 64 20 73  sed  0 {raised s
06e0: 75 6e 6b 65 6e 20 66 6c 61 74 20 72 69 64 67 65  unken flat ridge
06f0: 20 73 6f 6c 69 64 20 67 72 6f 6f 76 65 20 6c 69   solid groove li
0700: 6e 6b 7d 7d 0a 20 20 20 20 7d 0a 0a 20 20 20 20  nk}}.    }..    
0710: 44 79 6e 61 6d 69 63 48 65 6c 70 3a 3a 69 6e 63  DynamicHelp::inc
0720: 6c 75 64 65 20 42 75 74 74 6f 6e 20 62 61 6c 6c  lude Button ball
0730: 6f 6f 6e 0a 0a 20 20 20 20 76 61 72 69 61 62 6c  oon..    variabl
0740: 65 20 5f 63 75 72 72 65 6e 74 20 22 22 0a 20 20  e _current "".  
0750: 20 20 76 61 72 69 61 62 6c 65 20 5f 70 72 65 73    variable _pres
0760: 73 65 64 20 22 22 0a 0a 20 20 20 20 62 69 6e 64  sed ""..    bind
0770: 20 42 77 42 75 74 74 6f 6e 20 3c 45 6e 74 65 72   BwButton <Enter
0780: 3e 20 20 20 20 20 20 20 20 20 20 20 7b 42 75 74  >           {But
0790: 74 6f 6e 3a 3a 5f 65 6e 74 65 72 20 25 57 7d 0a  ton::_enter %W}.
07a0: 20 20 20 20 62 69 6e 64 20 42 77 42 75 74 74 6f      bind BwButto
07b0: 6e 20 3c 4c 65 61 76 65 3e 20 20 20 20 20 20 20  n <Leave>       
07c0: 20 20 20 20 7b 42 75 74 74 6f 6e 3a 3a 5f 6c 65      {Button::_le
07d0: 61 76 65 20 25 57 7d 0a 20 20 20 20 62 69 6e 64  ave %W}.    bind
07e0: 20 42 77 42 75 74 74 6f 6e 20 3c 42 75 74 74 6f   BwButton <Butto
07f0: 6e 50 72 65 73 73 2d 31 3e 20 20 20 7b 42 75 74  nPress-1>   {But
0800: 74 6f 6e 3a 3a 5f 70 72 65 73 73 20 25 57 7d 0a  ton::_press %W}.
0810: 20 20 20 20 62 69 6e 64 20 42 77 42 75 74 74 6f      bind BwButto
0820: 6e 20 3c 42 75 74 74 6f 6e 52 65 6c 65 61 73 65  n <ButtonRelease
0830: 2d 31 3e 20 7b 42 75 74 74 6f 6e 3a 3a 5f 72 65  -1> {Button::_re
0840: 6c 65 61 73 65 20 25 57 7d 0a 20 20 20 20 62 69  lease %W}.    bi
0850: 6e 64 20 42 77 42 75 74 74 6f 6e 20 3c 4b 65 79  nd BwButton <Key
0860: 2d 73 70 61 63 65 3e 20 20 20 20 20 20 20 7b 42  -space>       {B
0870: 75 74 74 6f 6e 3a 3a 69 6e 76 6f 6b 65 20 25 57  utton::invoke %W
0880: 3b 20 62 72 65 61 6b 7d 0a 20 20 20 20 62 69 6e  ; break}.    bin
0890: 64 20 42 77 42 75 74 74 6f 6e 20 3c 52 65 74 75  d BwButton <Retu
08a0: 72 6e 3e 20 20 20 20 20 20 20 20 20 20 7b 42 75  rn>          {Bu
08b0: 74 74 6f 6e 3a 3a 69 6e 76 6f 6b 65 20 25 57 3b  tton::invoke %W;
08c0: 20 62 72 65 61 6b 7d 0a 20 20 20 20 62 69 6e 64   break}.    bind
08d0: 20 42 77 42 75 74 74 6f 6e 20 3c 3c 49 6e 76 6f   BwButton <<Invo
08e0: 6b 65 3e 3e 20 09 20 20 20 20 7b 42 75 74 74 6f  ke>> .    {Butto
08f0: 6e 3a 3a 69 6e 76 6f 6b 65 20 25 57 3b 20 62 72  n::invoke %W; br
0900: 65 61 6b 7d 0a 20 20 20 20 62 69 6e 64 20 42 77  eak}.    bind Bw
0910: 42 75 74 74 6f 6e 20 3c 44 65 73 74 72 6f 79 3e  Button <Destroy>
0920: 20 20 20 20 20 20 20 20 20 7b 57 69 64 67 65 74           {Widget
0930: 3a 3a 64 65 73 74 72 6f 79 20 25 57 7d 0a 7d 0a  ::destroy %W}.}.
0940: 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..# ------------
0950: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0960: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0970: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0980: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0990: 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 42 75 74 74  .#  Command Butt
09a0: 6f 6e 3a 3a 63 72 65 61 74 65 0a 23 20 2d 2d 2d  on::create.# ---
09b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
09c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
09d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
09e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
09f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 42  ---------.proc B
0a00: 75 74 74 6f 6e 3a 3a 63 72 65 61 74 65 20 7b 20  utton::create { 
0a10: 70 61 74 68 20 61 72 67 73 20 7d 20 7b 0a 20 20  path args } {.  
0a20: 20 20 61 72 72 61 79 20 73 65 74 20 6d 61 70 73    array set maps
0a30: 20 5b 6c 69 73 74 20 42 75 74 74 6f 6e 20 7b 7d   [list Button {}
0a40: 20 3a 63 6d 64 20 7b 7d 5d 0a 20 20 20 20 61 72   :cmd {}].    ar
0a50: 72 61 79 20 73 65 74 20 6d 61 70 73 20 5b 57 69  ray set maps [Wi
0a60: 64 67 65 74 3a 3a 70 61 72 73 65 41 72 67 73 20  dget::parseArgs 
0a70: 42 75 74 74 6f 6e 20 24 61 72 67 73 5d 0a 20 20  Button $args].  
0a80: 20 20 69 66 20 7b 24 3a 3a 57 69 64 67 65 74 3a    if {$::Widget:
0a90: 3a 5f 74 68 65 6d 65 7d 20 7b 0a 20 20 20 20 20  :_theme} {.     
0aa0: 20 20 20 65 76 61 6c 20 5b 63 6f 6e 63 61 74 20     eval [concat 
0ab0: 5b 6c 69 73 74 20 74 74 6b 3a 3a 62 75 74 74 6f  [list ttk::butto
0ac0: 6e 20 24 70 61 74 68 5d 20 24 6d 61 70 73 28 3a  n $path] $maps(:
0ad0: 63 6d 64 29 5d 0a 20 20 20 20 7d 20 65 6c 73 65  cmd)].    } else
0ae0: 20 7b 0a 20 20 20 20 20 20 20 20 65 76 61 6c 20   {.        eval 
0af0: 5b 63 6f 6e 63 61 74 20 5b 6c 69 73 74 20 62 75  [concat [list bu
0b00: 74 74 6f 6e 20 24 70 61 74 68 5d 20 24 6d 61 70  tton $path] $map
0b10: 73 28 3a 63 6d 64 29 5d 0a 20 20 20 20 7d 0a 20  s(:cmd)].    }. 
0b20: 20 20 20 57 69 64 67 65 74 3a 3a 69 6e 69 74 46     Widget::initF
0b30: 72 6f 6d 4f 44 42 20 42 75 74 74 6f 6e 20 24 70  romODB Button $p
0b40: 61 74 68 20 24 6d 61 70 73 28 42 75 74 74 6f 6e  ath $maps(Button
0b50: 29 0a 0a 20 20 20 20 23 20 44 6f 20 73 6f 6d 65  )..    # Do some
0b60: 20 65 78 74 72 61 20 63 6f 6e 66 69 67 75 72 61   extra configura
0b70: 74 69 6f 6e 20 6f 6e 20 74 68 65 20 62 75 74 74  tion on the butt
0b80: 6f 6e 0a 20 20 20 20 73 65 74 20 76 61 72 20 5b  on.    set var [
0b90: 57 69 64 67 65 74 3a 3a 67 65 74 4d 65 67 61 77  Widget::getMegaw
0ba0: 69 64 67 65 74 4f 70 74 69 6f 6e 20 24 70 61 74  idgetOption $pat
0bb0: 68 20 2d 74 65 78 74 76 61 72 69 61 62 6c 65 5d  h -textvariable]
0bc0: 0a 20 20 20 20 73 65 74 20 73 74 20 5b 57 69 64  .    set st [Wid
0bd0: 67 65 74 3a 3a 67 65 74 4d 65 67 61 77 69 64 67  get::getMegawidg
0be0: 65 74 4f 70 74 69 6f 6e 20 24 70 61 74 68 20 2d  etOption $path -
0bf0: 73 74 61 74 65 5d 0a 20 20 20 20 69 66 20 7b 20  state].    if { 
0c00: 20 21 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68   ![string length
0c10: 20 24 76 61 72 5d 20 7d 20 7b 0a 20 20 20 20 20   $var] } {.     
0c20: 20 20 20 73 65 74 20 64 65 73 63 20 5b 42 57 69     set desc [BWi
0c30: 64 67 65 74 3a 3a 67 65 74 6e 61 6d 65 20 5b 57  dget::getname [W
0c40: 69 64 67 65 74 3a 3a 67 65 74 4d 65 67 61 77 69  idget::getMegawi
0c50: 64 67 65 74 4f 70 74 69 6f 6e 20 24 70 61 74 68  dgetOption $path
0c60: 20 2d 6e 61 6d 65 5d 5d 0a 20 20 20 20 20 20 20   -name]].       
0c70: 20 69 66 20 7b 20 5b 6c 6c 65 6e 67 74 68 20 24   if { [llength $
0c80: 64 65 73 63 5d 20 7d 20 7b 0a 20 20 20 20 20 20  desc] } {.      
0c90: 20 20 20 20 20 20 73 65 74 20 74 65 78 74 20 20        set text  
0ca0: 5b 6c 69 6e 64 65 78 20 24 64 65 73 63 20 30 5d  [lindex $desc 0]
0cb0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74  .            set
0cc0: 20 75 6e 64 65 72 20 5b 6c 69 6e 64 65 78 20 24   under [lindex $
0cd0: 64 65 73 63 20 31 5d 0a 20 20 20 20 20 20 20 20  desc 1].        
0ce0: 20 20 20 20 57 69 64 67 65 74 3a 3a 63 6f 6e 66      Widget::conf
0cf0: 69 67 75 72 65 20 24 70 61 74 68 20 5b 6c 69 73  igure $path [lis
0d00: 74 20 2d 74 65 78 74 20 24 74 65 78 74 5d 0a 20  t -text $text]. 
0d10: 20 20 20 20 20 20 20 20 20 20 20 57 69 64 67 65             Widge
0d20: 74 3a 3a 63 6f 6e 66 69 67 75 72 65 20 24 70 61  t::configure $pa
0d30: 74 68 20 5b 6c 69 73 74 20 2d 75 6e 64 65 72 6c  th [list -underl
0d40: 69 6e 65 20 24 75 6e 64 65 72 5d 0a 20 20 20 20  ine $under].    
0d50: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20      } else {.   
0d60: 20 20 20 20 20 20 20 20 20 73 65 74 20 74 65 78           set tex
0d70: 74 20 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d  t  [Widget::getM
0d80: 65 67 61 77 69 64 67 65 74 4f 70 74 69 6f 6e 20  egawidgetOption 
0d90: 24 70 61 74 68 20 2d 74 65 78 74 5d 0a 20 20 20  $path -text].   
0da0: 20 20 20 20 20 20 20 20 20 73 65 74 20 75 6e 64           set und
0db0: 65 72 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d  er [Widget::getM
0dc0: 65 67 61 77 69 64 67 65 74 4f 70 74 69 6f 6e 20  egawidgetOption 
0dd0: 24 70 61 74 68 20 2d 75 6e 64 65 72 6c 69 6e 65  $path -underline
0de0: 5d 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20  ].        }.    
0df0: 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20  } else {.       
0e00: 20 73 65 74 20 75 6e 64 65 72 20 2d 31 0a 20 20   set under -1.  
0e10: 20 20 20 20 20 20 73 65 74 20 74 65 78 74 20 20        set text  
0e20: 22 22 0a 20 20 20 20 20 20 20 20 57 69 64 67 65  "".        Widge
0e30: 74 3a 3a 63 6f 6e 66 69 67 75 72 65 20 24 70 61  t::configure $pa
0e40: 74 68 20 5b 6c 69 73 74 20 2d 75 6e 64 65 72 6c  th [list -underl
0e50: 69 6e 65 20 24 75 6e 64 65 72 5d 0a 20 20 20 20  ine $under].    
0e60: 7d 0a 0a 20 20 20 20 24 70 61 74 68 20 63 6f 6e  }..    $path con
0e70: 66 69 67 75 72 65 20 2d 74 65 78 74 20 24 74 65  figure -text $te
0e80: 78 74 20 2d 75 6e 64 65 72 6c 69 6e 65 20 24 75  xt -underline $u
0e90: 6e 64 65 72 20 5c 0a 20 20 20 20 20 20 20 20 2d  nder \.        -
0ea0: 74 65 78 74 76 61 72 69 61 62 6c 65 20 24 76 61  textvariable $va
0eb0: 72 20 2d 73 74 61 74 65 20 24 73 74 0a 20 20 20  r -state $st.   
0ec0: 20 23 20 4d 61 70 20 72 65 6c 69 65 66 20 66 6c   # Map relief fl
0ed0: 61 74 20 6f 6e 20 54 6f 6f 6c 62 75 74 74 6f 6e  at on Toolbutton
0ee0: 20 66 6f 72 20 74 74 6b 0a 20 20 20 20 73 65 74   for ttk.    set
0ef0: 20 72 65 6c 69 65 66 20 5b 57 69 64 67 65 74 3a   relief [Widget:
0f00: 3a 67 65 74 4d 65 67 61 77 69 64 67 65 74 4f 70  :getMegawidgetOp
0f10: 74 69 6f 6e 20 24 70 61 74 68 20 2d 72 65 6c 69  tion $path -reli
0f20: 65 66 5d 0a 20 20 20 20 69 66 20 7b 24 3a 3a 57  ef].    if {$::W
0f30: 69 64 67 65 74 3a 3a 5f 74 68 65 6d 65 7d 20 7b  idget::_theme} {
0f40: 0a 20 20 20 20 20 20 20 20 69 66 20 7b 20 5b 73  .        if { [s
0f50: 74 72 69 6e 67 20 65 71 75 61 6c 20 24 72 65 6c  tring equal $rel
0f60: 69 65 66 20 22 6c 69 6e 6b 22 5d 20 7d 20 7b 0a  ief "link"] } {.
0f70: 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61 74              $pat
0f80: 68 20 63 6f 6e 66 69 67 75 72 65 20 2d 73 74 79  h configure -sty
0f90: 6c 65 20 54 6f 6f 6c 62 75 74 74 6f 6e 0a 20 20  le Toolbutton.  
0fa0: 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 20 65 6c        }.    } el
0fb0: 73 65 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20  se {.        if 
0fc0: 7b 20 5b 73 74 72 69 6e 67 20 65 71 75 61 6c 20  { [string equal 
0fd0: 24 72 65 6c 69 65 66 20 22 6c 69 6e 6b 22 5d 20  $relief "link"] 
0fe0: 7d 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20  } {.            
0ff0: 73 65 74 20 72 65 6c 69 65 66 20 22 66 6c 61 74  set relief "flat
1000: 22 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20  ".        }.    
1010: 20 20 20 20 24 70 61 74 68 20 63 6f 6e 66 69 67      $path config
1020: 75 72 65 20 2d 72 65 6c 69 65 66 20 24 72 65 6c  ure -relief $rel
1030: 69 65 66 0a 20 20 20 20 7d 0a 20 20 20 20 62 69  ief.    }.    bi
1040: 6e 64 74 61 67 73 20 24 70 61 74 68 20 5b 6c 69  ndtags $path [li
1050: 73 74 20 24 70 61 74 68 20 42 77 42 75 74 74 6f  st $path BwButto
1060: 6e 20 5b 77 69 6e 66 6f 20 74 6f 70 6c 65 76 65  n [winfo topleve
1070: 6c 20 24 70 61 74 68 5d 20 61 6c 6c 5d 0a 0a 20  l $path] all].. 
1080: 20 20 20 73 65 74 20 61 63 63 65 6c 31 20 5b 73     set accel1 [s
1090: 74 72 69 6e 67 20 74 6f 6c 6f 77 65 72 20 5b 73  tring tolower [s
10a0: 74 72 69 6e 67 20 69 6e 64 65 78 20 24 74 65 78  tring index $tex
10b0: 74 20 24 75 6e 64 65 72 5d 5d 0a 20 20 20 20 73  t $under]].    s
10c0: 65 74 20 61 63 63 65 6c 32 20 5b 73 74 72 69 6e  et accel2 [strin
10d0: 67 20 74 6f 75 70 70 65 72 20 24 61 63 63 65 6c  g toupper $accel
10e0: 31 5d 0a 20 20 20 20 69 66 20 7b 20 24 61 63 63  1].    if { $acc
10f0: 65 6c 31 20 21 3d 20 22 22 20 7d 20 7b 0a 20 20  el1 != "" } {.  
1100: 20 20 20 20 20 20 62 69 6e 64 20 5b 77 69 6e 66        bind [winf
1110: 6f 20 74 6f 70 6c 65 76 65 6c 20 24 70 61 74 68  o toplevel $path
1120: 5d 20 3c 41 6c 74 2d 24 61 63 63 65 6c 31 3e 20  ] <Alt-$accel1> 
1130: 5b 6c 69 73 74 20 42 75 74 74 6f 6e 3a 3a 69 6e  [list Button::in
1140: 76 6f 6b 65 20 24 70 61 74 68 5d 0a 20 20 20 20  voke $path].    
1150: 20 20 20 20 62 69 6e 64 20 5b 77 69 6e 66 6f 20      bind [winfo 
1160: 74 6f 70 6c 65 76 65 6c 20 24 70 61 74 68 5d 20  toplevel $path] 
1170: 3c 41 6c 74 2d 24 61 63 63 65 6c 32 3e 20 5b 6c  <Alt-$accel2> [l
1180: 69 73 74 20 42 75 74 74 6f 6e 3a 3a 69 6e 76 6f  ist Button::invo
1190: 6b 65 20 24 70 61 74 68 5d 0a 20 20 20 20 7d 0a  ke $path].    }.
11a0: 0a 20 20 20 20 44 79 6e 61 6d 69 63 48 65 6c 70  .    DynamicHelp
11b0: 3a 3a 73 65 74 68 65 6c 70 20 24 70 61 74 68 20  ::sethelp $path 
11c0: 24 70 61 74 68 20 31 0a 0a 20 20 20 20 72 65 74  $path 1..    ret
11d0: 75 72 6e 20 5b 57 69 64 67 65 74 3a 3a 63 72 65  urn [Widget::cre
11e0: 61 74 65 20 42 75 74 74 6f 6e 20 24 70 61 74 68  ate Button $path
11f0: 5d 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d  ].}...# --------
1200: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1210: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1220: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1230: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1240: 2d 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e 64 20  ----.#  Command 
1250: 42 75 74 74 6f 6e 3a 3a 63 6f 6e 66 69 67 75 72  Button::configur
1260: 65 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  e.# ------------
1270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1280: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1290: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
12b0: 0a 70 72 6f 63 20 42 75 74 74 6f 6e 3a 3a 63 6f  .proc Button::co
12c0: 6e 66 69 67 75 72 65 20 7b 20 70 61 74 68 20 61  nfigure { path a
12d0: 72 67 73 20 7d 20 7b 0a 20 20 20 20 73 65 74 20  rgs } {.    set 
12e0: 6f 6c 64 75 6e 64 65 72 20 5b 24 70 61 74 68 3a  oldunder [$path:
12f0: 63 6d 64 20 63 67 65 74 20 2d 75 6e 64 65 72 6c  cmd cget -underl
1300: 69 6e 65 5d 0a 20 20 20 20 69 66 20 7b 20 24 6f  ine].    if { $o
1310: 6c 64 75 6e 64 65 72 20 21 3d 20 2d 31 20 7d 20  ldunder != -1 } 
1320: 7b 0a 20 20 20 20 20 20 20 20 73 65 74 20 6f 6c  {.        set ol
1330: 64 61 63 63 65 6c 31 20 5b 73 74 72 69 6e 67 20  daccel1 [string 
1340: 74 6f 6c 6f 77 65 72 20 5b 73 74 72 69 6e 67 20  tolower [string 
1350: 69 6e 64 65 78 20 5b 24 70 61 74 68 3a 63 6d 64  index [$path:cmd
1360: 20 63 67 65 74 20 2d 74 65 78 74 5d 20 24 6f 6c   cget -text] $ol
1370: 64 75 6e 64 65 72 5d 5d 0a 20 20 20 20 20 20 20  dunder]].       
1380: 20 73 65 74 20 6f 6c 64 61 63 63 65 6c 32 20 5b   set oldaccel2 [
1390: 73 74 72 69 6e 67 20 74 6f 75 70 70 65 72 20 24  string toupper $
13a0: 6f 6c 64 61 63 63 65 6c 31 5d 0a 20 20 20 20 7d  oldaccel1].    }
13b0: 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20   else {.        
13c0: 73 65 74 20 6f 6c 64 61 63 63 65 6c 31 20 22 22  set oldaccel1 ""
13d0: 0a 20 20 20 20 20 20 20 20 73 65 74 20 6f 6c 64  .        set old
13e0: 61 63 63 65 6c 32 20 22 22 0a 20 20 20 20 7d 0a  accel2 "".    }.
13f0: 20 20 20 20 73 65 74 20 72 65 73 20 5b 57 69 64      set res [Wid
1400: 67 65 74 3a 3a 63 6f 6e 66 69 67 75 72 65 20 24  get::configure $
1410: 70 61 74 68 20 24 61 72 67 73 5d 0a 0a 20 20 20  path $args]..   
1420: 20 23 20 45 78 74 72 61 63 74 20 61 6c 6c 20 74   # Extract all t
1430: 68 65 20 6d 6f 64 69 66 69 65 64 20 62 69 74 73  he modified bits
1440: 20 77 65 27 72 65 20 69 6e 74 65 72 65 73 74 65   we're intereste
1450: 64 20 69 6e 0a 20 20 20 20 66 6f 72 65 61 63 68  d in.    foreach
1460: 20 7b 63 72 20 63 73 20 63 76 20 63 6e 20 63 74   {cr cs cv cn ct
1470: 20 63 75 7d 20 5b 57 69 64 67 65 74 3a 3a 68 61   cu} [Widget::ha
1480: 73 43 68 61 6e 67 65 64 58 20 24 70 61 74 68 20  sChangedX $path 
1490: 5c 0a 20 20 20 20 20 20 20 20 2d 72 65 6c 69 65  \.        -relie
14a0: 66 20 2d 73 74 61 74 65 20 2d 74 65 78 74 76 61  f -state -textva
14b0: 72 69 61 62 6c 65 20 2d 6e 61 6d 65 20 2d 74 65  riable -name -te
14c0: 78 74 20 2d 75 6e 64 65 72 6c 69 6e 65 5d 20 62  xt -underline] b
14d0: 72 65 61 6b 0a 20 20 20 20 69 66 20 7b 20 24 63  reak.    if { $c
14e0: 72 20 7c 7c 20 24 63 73 20 7d 20 7b 0a 20 20 20  r || $cs } {.   
14f0: 20 20 20 20 20 73 65 74 20 72 65 6c 69 65 66 20       set relief 
1500: 5b 57 69 64 67 65 74 3a 3a 63 67 65 74 20 24 70  [Widget::cget $p
1510: 61 74 68 20 2d 72 65 6c 69 65 66 5d 0a 20 20 20  ath -relief].   
1520: 20 20 20 20 20 73 65 74 20 73 74 61 74 65 20 20       set state  
1530: 5b 57 69 64 67 65 74 3a 3a 63 67 65 74 20 24 70  [Widget::cget $p
1540: 61 74 68 20 2d 73 74 61 74 65 5d 0a 20 20 20 20  ath -state].    
1550: 20 20 20 20 69 66 20 7b 20 24 3a 3a 57 69 64 67      if { $::Widg
1560: 65 74 3a 3a 5f 74 68 65 6d 65 7d 20 7b 0a 09 09  et::_theme} {...
1570: 09 69 66 20 7b 20 5b 73 74 72 69 6e 67 20 65 71  .if { [string eq
1580: 75 61 6c 20 24 72 65 6c 69 65 66 20 22 6c 69 6e  ual $relief "lin
1590: 6b 22 5d 20 7d 20 7b 0a 09 09 09 09 24 70 61 74  k"] } {.....$pat
15a0: 68 3a 63 6d 64 20 63 6f 6e 66 69 67 75 72 65 20  h:cmd configure 
15b0: 2d 73 74 79 6c 65 20 54 6f 6f 6c 62 75 74 74 6f  -style Toolbutto
15c0: 6e 0a 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09  n....} else {...
15d0: 09 09 24 70 61 74 68 3a 63 6d 64 20 63 6f 6e 66  ..$path:cmd conf
15e0: 69 67 75 72 65 20 2d 73 74 79 6c 65 20 22 22 0a  igure -style "".
15f0: 09 09 09 7d 0a 09 09 7d 20 65 6c 73 65 20 7b 0a  ...}...} else {.
1600: 09 09 09 69 66 20 7b 20 5b 73 74 72 69 6e 67 20  ...if { [string 
1610: 65 71 75 61 6c 20 24 72 65 6c 69 65 66 20 22 6c  equal $relief "l
1620: 69 6e 6b 22 5d 20 7d 20 7b 0a 09 09 09 09 69 66  ink"] } {.....if
1630: 20 7b 20 5b 73 74 72 69 6e 67 20 65 71 75 61 6c   { [string equal
1640: 20 24 73 74 61 74 65 20 22 61 63 74 69 76 65 22   $state "active"
1650: 5d 20 7d 20 7b 0a 09 09 09 09 09 73 65 74 20 72  ] } {......set r
1660: 65 6c 69 65 66 20 22 72 61 69 73 65 64 22 0a 09  elief "raised"..
1670: 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09  ...} else {.....
1680: 09 73 65 74 20 72 65 6c 69 65 66 20 22 66 6c 61  .set relief "fla
1690: 74 22 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09  t".....}....}...
16a0: 09 24 70 61 74 68 3a 63 6d 64 20 63 6f 6e 66 69  .$path:cmd confi
16b0: 67 75 72 65 20 2d 72 65 6c 69 65 66 20 24 72 65  gure -relief $re
16c0: 6c 69 65 66 0a 09 09 7d 0a 09 09 24 70 61 74 68  lief...}...$path
16d0: 3a 63 6d 64 20 63 6f 6e 66 69 67 75 72 65 20 2d  :cmd configure -
16e0: 73 74 61 74 65 20 24 73 74 61 74 65 0a 20 20 20  state $state.   
16f0: 20 7d 0a 0a 20 20 20 20 69 66 20 7b 20 24 63 76   }..    if { $cv
1700: 20 7c 7c 20 24 63 6e 20 7c 7c 20 24 63 74 20 7c   || $cn || $ct |
1710: 7c 20 24 63 75 20 7d 20 7b 0a 20 20 20 20 20 20  | $cu } {.      
1720: 20 20 73 65 74 20 76 61 72 09 09 5b 57 69 64 67    set var..[Widg
1730: 65 74 3a 3a 63 67 65 74 20 24 70 61 74 68 20 2d  et::cget $path -
1740: 74 65 78 74 76 61 72 69 61 62 6c 65 5d 0a 20 20  textvariable].  
1750: 20 20 20 20 20 20 73 65 74 20 74 65 78 74 09 5b        set text.[
1760: 57 69 64 67 65 74 3a 3a 63 67 65 74 20 24 70 61  Widget::cget $pa
1770: 74 68 20 2d 74 65 78 74 5d 0a 20 20 20 20 20 20  th -text].      
1780: 20 20 73 65 74 20 75 6e 64 65 72 09 5b 57 69 64    set under.[Wid
1790: 67 65 74 3a 3a 63 67 65 74 20 24 70 61 74 68 20  get::cget $path 
17a0: 2d 75 6e 64 65 72 6c 69 6e 65 5d 0a 20 20 20 20  -underline].    
17b0: 20 20 20 20 69 66 20 7b 20 20 21 5b 73 74 72 69      if {  ![stri
17c0: 6e 67 20 6c 65 6e 67 74 68 20 24 76 61 72 5d 20  ng length $var] 
17d0: 7d 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20  } {.            
17e0: 73 65 74 20 64 65 73 63 20 5b 42 57 69 64 67 65  set desc [BWidge
17f0: 74 3a 3a 67 65 74 6e 61 6d 65 20 5b 57 69 64 67  t::getname [Widg
1800: 65 74 3a 3a 63 67 65 74 20 24 70 61 74 68 20 2d  et::cget $path -
1810: 6e 61 6d 65 5d 5d 0a 20 20 20 20 20 20 20 20 20  name]].         
1820: 20 20 20 69 66 20 7b 20 5b 6c 6c 65 6e 67 74 68     if { [llength
1830: 20 24 64 65 73 63 5d 20 7d 20 7b 0a 20 20 20 20   $desc] } {.    
1840: 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20              set 
1850: 74 65 78 74 20 20 5b 6c 69 6e 64 65 78 20 24 64  text  [lindex $d
1860: 65 73 63 20 30 5d 0a 20 20 20 20 20 20 20 20 20  esc 0].         
1870: 20 20 20 20 20 20 20 73 65 74 20 75 6e 64 65 72         set under
1880: 20 5b 6c 69 6e 64 65 78 20 24 64 65 73 63 20 31   [lindex $desc 1
1890: 5d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a  ].            }.
18a0: 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b          } else {
18b0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74  .            set
18c0: 20 75 6e 64 65 72 20 2d 31 0a 20 20 20 20 20 20   under -1.      
18d0: 20 20 20 20 20 20 73 65 74 20 74 65 78 74 20 20        set text  
18e0: 22 22 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20  "".        }.   
18f0: 20 20 20 20 20 73 65 74 20 74 6f 70 20 5b 77 69       set top [wi
1900: 6e 66 6f 20 74 6f 70 6c 65 76 65 6c 20 24 70 61  nfo toplevel $pa
1910: 74 68 5d 0a 20 20 20 20 20 20 20 20 69 66 20 7b  th].        if {
1920: 20 24 6f 6c 64 61 63 63 65 6c 31 20 21 3d 20 22   $oldaccel1 != "
1930: 22 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 20 20  " } {.          
1940: 20 20 62 69 6e 64 20 24 74 6f 70 20 3c 41 6c 74    bind $top <Alt
1950: 2d 24 6f 6c 64 61 63 63 65 6c 31 3e 20 7b 7d 0a  -$oldaccel1> {}.
1960: 20 20 20 20 20 20 20 20 20 20 20 20 62 69 6e 64              bind
1970: 20 24 74 6f 70 20 3c 41 6c 74 2d 24 6f 6c 64 61   $top <Alt-$olda
1980: 63 63 65 6c 32 3e 20 7b 7d 0a 20 20 20 20 20 20  ccel2> {}.      
1990: 20 20 7d 0a 20 20 20 20 20 20 20 20 73 65 74 20    }.        set 
19a0: 61 63 63 65 6c 31 20 5b 73 74 72 69 6e 67 20 74  accel1 [string t
19b0: 6f 6c 6f 77 65 72 20 5b 73 74 72 69 6e 67 20 69  olower [string i
19c0: 6e 64 65 78 20 24 74 65 78 74 20 24 75 6e 64 65  ndex $text $unde
19d0: 72 5d 5d 0a 20 20 20 20 20 20 20 20 73 65 74 20  r]].        set 
19e0: 61 63 63 65 6c 32 20 5b 73 74 72 69 6e 67 20 74  accel2 [string t
19f0: 6f 75 70 70 65 72 20 24 61 63 63 65 6c 31 5d 0a  oupper $accel1].
1a00: 20 20 20 20 20 20 20 20 69 66 20 7b 20 24 61 63          if { $ac
1a10: 63 65 6c 31 20 21 3d 20 22 22 20 7d 20 7b 0a 20  cel1 != "" } {. 
1a20: 20 20 20 20 20 20 20 20 20 20 20 62 69 6e 64 20             bind 
1a30: 24 74 6f 70 20 3c 41 6c 74 2d 24 61 63 63 65 6c  $top <Alt-$accel
1a40: 31 3e 20 5b 6c 69 73 74 20 42 75 74 74 6f 6e 3a  1> [list Button:
1a50: 3a 69 6e 76 6f 6b 65 20 24 70 61 74 68 5d 0a 20  :invoke $path]. 
1a60: 20 20 20 20 20 20 20 20 20 20 20 62 69 6e 64 20             bind 
1a70: 24 74 6f 70 20 3c 41 6c 74 2d 24 61 63 63 65 6c  $top <Alt-$accel
1a80: 32 3e 20 5b 6c 69 73 74 20 42 75 74 74 6f 6e 3a  2> [list Button:
1a90: 3a 69 6e 76 6f 6b 65 20 24 70 61 74 68 5d 0a 20  :invoke $path]. 
1aa0: 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20         }.       
1ab0: 20 24 70 61 74 68 3a 63 6d 64 20 63 6f 6e 66 69   $path:cmd confi
1ac0: 67 75 72 65 20 2d 74 65 78 74 20 24 74 65 78 74  gure -text $text
1ad0: 20 2d 75 6e 64 65 72 6c 69 6e 65 20 24 75 6e 64   -underline $und
1ae0: 65 72 20 2d 74 65 78 74 76 61 72 69 61 62 6c 65  er -textvariable
1af0: 20 24 76 61 72 0a 20 20 20 20 7d 0a 20 20 20 20   $var.    }.    
1b00: 44 79 6e 61 6d 69 63 48 65 6c 70 3a 3a 73 65 74  DynamicHelp::set
1b10: 68 65 6c 70 20 24 70 61 74 68 20 24 70 61 74 68  help $path $path
1b20: 0a 0a 20 20 20 20 73 65 74 20 72 65 73 0a 7d 0a  ..    set res.}.
1b30: 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..# ------------
1b40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b80: 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 42 75 74 74  .#  Command Butt
1b90: 6f 6e 3a 3a 63 67 65 74 0a 23 20 2d 2d 2d 2d 2d  on::cget.# -----
1ba0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1bd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1be0: 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 42 75 74  -------.proc But
1bf0: 74 6f 6e 3a 3a 63 67 65 74 20 7b 20 70 61 74 68  ton::cget { path
1c00: 20 6f 70 74 69 6f 6e 20 7d 20 7b 0a 20 20 20 20   option } {.    
1c10: 57 69 64 67 65 74 3a 3a 63 67 65 74 20 24 70 61  Widget::cget $pa
1c20: 74 68 20 24 6f 70 74 69 6f 6e 0a 7d 0a 0a 0a 23  th $option.}...#
1c30: 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   ---------------
1c40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1c70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20  -------------.# 
1c80: 20 43 6f 6d 6d 61 6e 64 20 42 75 74 74 6f 6e 3a   Command Button:
1c90: 3a 69 64 65 6e 74 69 66 79 0a 23 20 2d 2d 2d 2d  :identify.# ----
1ca0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1cd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ce0: 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 42 75  --------.proc Bu
1cf0: 74 74 6f 6e 3a 3a 69 64 65 6e 74 69 66 79 20 7b  tton::identify {
1d00: 20 70 61 74 68 20 61 72 67 73 20 7d 20 7b 0a 20   path args } {. 
1d10: 20 20 20 65 76 61 6c 20 24 70 61 74 68 3a 63 6d     eval $path:cm
1d20: 64 20 69 64 65 6e 74 69 66 79 20 24 61 72 67 73  d identify $args
1d30: 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d  .}...# ---------
1d40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1d80: 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 42  ---.#  Command B
1d90: 75 74 74 6f 6e 3a 3a 69 6e 73 74 61 74 65 0a 23  utton::instate.#
1da0: 20 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 2d 2d 2d 0a 70 72  -------------.pr
1df0: 6f 63 20 42 75 74 74 6f 6e 3a 3a 69 6e 73 74 61  oc Button::insta
1e00: 74 65 20 7b 20 70 61 74 68 20 61 72 67 73 20 7d  te { path args }
1e10: 20 7b 0a 20 20 20 20 65 76 61 6c 20 24 70 61 74   {.    eval $pat
1e20: 68 3a 63 6d 64 20 69 6e 73 74 61 74 65 20 24 61  h:cmd instate $a
1e30: 72 67 73 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d  rgs.}...# ------
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 2d 2d 2d 2d  ----------------
1e60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1e80: 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e  ------.#  Comman
1e90: 64 20 42 75 74 74 6f 6e 3a 3a 73 74 61 74 65 0a  d Button::state.
1ea0: 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  # --------------
1eb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ec0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ed0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ee0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70  --------------.p
1ef0: 72 6f 63 20 42 75 74 74 6f 6e 3a 3a 73 74 61 74  roc Button::stat
1f00: 65 20 7b 20 70 61 74 68 20 61 72 67 73 20 7d 20  e { path args } 
1f10: 7b 0a 20 20 20 20 65 76 61 6c 20 24 70 61 74 68  {.    eval $path
1f20: 3a 63 6d 64 20 73 74 61 74 65 20 24 61 72 67 73  :cmd state $args
1f30: 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d  .}...# ---------
1f40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f80: 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 42  ---.#  Command B
1f90: 75 74 74 6f 6e 3a 3a 69 6e 76 6f 6b 65 0a 23 20  utton::invoke.# 
1fa0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fb0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fc0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1fe0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f  ------------.pro
1ff0: 63 20 42 75 74 74 6f 6e 3a 3a 69 6e 76 6f 6b 65  c Button::invoke
2000: 20 7b 20 70 61 74 68 20 7d 20 7b 0a 20 20 20 20   { path } {.    
2010: 69 66 20 7b 20 21 5b 73 74 72 69 6e 67 20 65 71  if { ![string eq
2020: 75 61 6c 20 5b 24 70 61 74 68 3a 63 6d 64 20 63  ual [$path:cmd c
2030: 67 65 74 20 2d 73 74 61 74 65 5d 20 22 64 69 73  get -state] "dis
2040: 61 62 6c 65 64 22 5d 20 7d 20 7b 0a 20 20 20 20  abled"] } {.    
2050: 20 20 20 20 69 66 20 7b 20 24 3a 3a 57 69 64 67      if { $::Widg
2060: 65 74 3a 3a 5f 74 68 65 6d 65 7d 20 7b 0a 20 20  et::_theme} {.  
2070: 20 20 20 20 20 20 20 20 20 20 24 70 61 74 68 3a            $path:
2080: 63 6d 64 20 63 6f 6e 66 69 67 75 72 65 20 2d 73  cmd configure -s
2090: 74 61 74 65 20 61 63 74 69 76 65 0a 09 09 09 24  tate active....$
20a0: 70 61 74 68 3a 63 6d 64 20 73 74 61 74 65 20 70  path:cmd state p
20b0: 72 65 73 73 65 64 0a 20 20 20 20 20 20 20 20 7d  ressed.        }
20c0: 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20   else {.        
20d0: 20 20 20 20 24 70 61 74 68 3a 63 6d 64 20 63 6f      $path:cmd co
20e0: 6e 66 69 67 75 72 65 20 2d 73 74 61 74 65 20 61  nfigure -state a
20f0: 63 74 69 76 65 20 2d 72 65 6c 69 65 66 20 73 75  ctive -relief su
2100: 6e 6b 65 6e 0a 20 20 20 20 20 20 20 20 7d 0a 20  nken.        }. 
2110: 20 20 20 20 20 20 20 75 70 64 61 74 65 20 69 64         update id
2120: 6c 65 74 61 73 6b 73 0a 20 20 20 20 20 20 20 20  letasks.        
2130: 73 65 74 20 63 6d 64 20 5b 57 69 64 67 65 74 3a  set cmd [Widget:
2140: 3a 67 65 74 4d 65 67 61 77 69 64 67 65 74 4f 70  :getMegawidgetOp
2150: 74 69 6f 6e 20 24 70 61 74 68 20 2d 61 72 6d 63  tion $path -armc
2160: 6f 6d 6d 61 6e 64 5d 0a 20 20 20 20 20 20 20 20  ommand].        
2170: 69 66 20 7b 20 24 63 6d 64 20 21 3d 20 22 22 20  if { $cmd != "" 
2180: 7d 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20  } {.            
2190: 75 70 6c 65 76 65 6c 20 5c 23 30 20 24 63 6d 64  uplevel \#0 $cmd
21a0: 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20  .        }.     
21b0: 20 20 20 61 66 74 65 72 20 31 30 30 0a 20 20 20     after 100.   
21c0: 20 20 20 20 20 24 70 61 74 68 3a 63 6d 64 20 63       $path:cmd c
21d0: 6f 6e 66 69 67 75 72 65 20 2d 73 74 61 74 65 20  onfigure -state 
21e0: 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d 65 67 61  [Widget::getMega
21f0: 77 69 64 67 65 74 4f 70 74 69 6f 6e 20 24 70 61  widgetOption $pa
2200: 74 68 20 2d 73 74 61 74 65 5d 0a 20 20 20 20 20  th -state].     
2210: 20 20 20 69 66 20 7b 20 24 3a 3a 57 69 64 67 65     if { $::Widge
2220: 74 3a 3a 5f 74 68 65 6d 65 7d 20 7b 0a 20 20 20  t::_theme} {.   
2230: 20 20 20 20 20 20 20 20 20 24 70 61 74 68 3a 63           $path:c
2240: 6d 64 20 73 74 61 74 65 20 21 70 72 65 73 73 65  md state !presse
2250: 64 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65  d.        } else
2260: 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 73   {.            s
2270: 65 74 20 72 65 6c 69 65 66 20 5b 57 69 64 67 65  et relief [Widge
2280: 74 3a 3a 67 65 74 4d 65 67 61 77 69 64 67 65 74  t::getMegawidget
2290: 4f 70 74 69 6f 6e 20 24 70 61 74 68 20 2d 72 65  Option $path -re
22a0: 6c 69 65 66 5d 0a 20 20 20 20 20 20 20 20 20 20  lief].          
22b0: 20 20 69 66 20 7b 20 5b 73 74 72 69 6e 67 20 65    if { [string e
22c0: 71 75 61 6c 20 24 72 65 6c 69 65 66 20 22 6c 69  qual $relief "li
22d0: 6e 6b 22 5d 20 7d 20 7b 0a 20 20 20 20 20 20 20  nk"] } {.       
22e0: 20 20 20 20 20 20 20 20 20 73 65 74 20 72 65 6c           set rel
22f0: 69 65 66 20 66 6c 61 74 0a 20 20 20 20 20 20 20  ief flat.       
2300: 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20       }.         
2310: 20 20 20 24 70 61 74 68 3a 63 6d 64 20 63 6f 6e     $path:cmd con
2320: 66 69 67 75 72 65 20 2d 72 65 6c 69 65 66 20 24  figure -relief $
2330: 72 65 6c 69 65 66 0a 20 20 20 20 20 20 20 20 7d  relief.        }
2340: 0a 20 20 20 20 20 20 20 20 73 65 74 20 63 6d 64  .        set cmd
2350: 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d 65 67   [Widget::getMeg
2360: 61 77 69 64 67 65 74 4f 70 74 69 6f 6e 20 24 70  awidgetOption $p
2370: 61 74 68 20 2d 64 69 73 61 72 6d 63 6f 6d 6d 61  ath -disarmcomma
2380: 6e 64 5d 0a 20 20 20 20 20 20 20 20 69 66 20 7b  nd].        if {
2390: 20 24 63 6d 64 20 21 3d 20 22 22 20 7d 20 7b 0a   $cmd != "" } {.
23a0: 20 20 20 20 20 20 20 20 20 20 20 20 75 70 6c 65              uple
23b0: 76 65 6c 20 5c 23 30 20 24 63 6d 64 0a 20 20 20  vel \#0 $cmd.   
23c0: 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 73       }.        s
23d0: 65 74 20 63 6d 64 20 5b 57 69 64 67 65 74 3a 3a  et cmd [Widget::
23e0: 67 65 74 4d 65 67 61 77 69 64 67 65 74 4f 70 74  getMegawidgetOpt
23f0: 69 6f 6e 20 24 70 61 74 68 20 2d 63 6f 6d 6d 61  ion $path -comma
2400: 6e 64 5d 0a 20 20 20 20 20 20 20 20 69 66 20 7b  nd].        if {
2410: 20 24 63 6d 64 20 21 3d 20 22 22 20 7d 20 7b 0a   $cmd != "" } {.
2420: 20 20 20 20 20 20 20 20 20 20 20 20 75 70 6c 65              uple
2430: 76 65 6c 20 5c 23 30 20 24 63 6d 64 0a 20 20 20  vel \#0 $cmd.   
2440: 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 7d 0a 0a       }.    }.}..
2450: 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  # --------------
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 0a 23  --------------.#
24a0: 20 20 43 6f 6d 6d 61 6e 64 20 42 75 74 74 6f 6e    Command Button
24b0: 3a 3a 5f 65 6e 74 65 72 0a 23 20 2d 2d 2d 2d 2d  ::_enter.# -----
24c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
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 0a 70 72 6f 63 20 42 75 74  -------.proc But
2510: 74 6f 6e 3a 3a 5f 65 6e 74 65 72 20 7b 20 70 61  ton::_enter { pa
2520: 74 68 20 7d 20 7b 0a 20 20 20 20 76 61 72 69 61  th } {.    varia
2530: 62 6c 65 20 5f 63 75 72 72 65 6e 74 0a 20 20 20  ble _current.   
2540: 20 76 61 72 69 61 62 6c 65 20 5f 70 72 65 73 73   variable _press
2550: 65 64 0a 0a 20 20 20 20 73 65 74 20 5f 63 75 72  ed..    set _cur
2560: 72 65 6e 74 20 24 70 61 74 68 0a 20 20 20 20 69  rent $path.    i
2570: 66 20 7b 20 21 5b 73 74 72 69 6e 67 20 65 71 75  f { ![string equ
2580: 61 6c 20 5b 24 70 61 74 68 3a 63 6d 64 20 63 67  al [$path:cmd cg
2590: 65 74 20 2d 73 74 61 74 65 5d 20 22 64 69 73 61  et -state] "disa
25a0: 62 6c 65 64 22 5d 20 7d 20 7b 0a 20 20 20 20 20  bled"] } {.     
25b0: 20 20 20 24 70 61 74 68 3a 63 6d 64 20 63 6f 6e     $path:cmd con
25c0: 66 69 67 75 72 65 20 2d 73 74 61 74 65 20 61 63  figure -state ac
25d0: 74 69 76 65 0a 20 20 20 20 20 20 20 20 69 66 20  tive.        if 
25e0: 7b 20 24 3a 3a 57 69 64 67 65 74 3a 3a 5f 74 68  { $::Widget::_th
25f0: 65 6d 65 20 7d 20 7b 0a 20 20 20 20 20 20 20 20  eme } {.        
2600: 20 20 20 20 23 20 24 70 61 74 68 3a 63 6d 64 20      # $path:cmd 
2610: 73 74 61 74 65 20 61 63 74 69 76 65 0a 20 20 20  state active.   
2620: 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20       } else {.  
2630: 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 20 24            if { $
2640: 5f 70 72 65 73 73 65 64 20 3d 3d 20 24 70 61 74  _pressed == $pat
2650: 68 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 20 20  h } {.          
2660: 20 20 20 20 20 20 24 70 61 74 68 3a 63 6d 64 20        $path:cmd 
2670: 63 6f 6e 66 69 67 75 72 65 20 2d 72 65 6c 69 65  configure -relie
2680: 66 20 73 75 6e 6b 65 6e 0a 20 20 20 20 20 20 20  f sunken.       
2690: 20 20 20 20 20 7d 20 65 6c 73 65 69 66 20 7b 20       } elseif { 
26a0: 5b 73 74 72 69 6e 67 20 65 71 75 61 6c 20 5b 57  [string equal [W
26b0: 69 64 67 65 74 3a 3a 63 67 65 74 20 24 70 61 74  idget::cget $pat
26c0: 68 20 2d 72 65 6c 69 65 66 5d 20 22 6c 69 6e 6b  h -relief] "link
26d0: 22 5d 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 20  "] } {.         
26e0: 20 20 20 20 20 20 20 24 70 61 74 68 3a 63 6d 64         $path:cmd
26f0: 20 63 6f 6e 66 69 67 75 72 65 20 2d 72 65 6c 69   configure -reli
2700: 65 66 20 72 61 69 73 65 64 0a 20 20 20 20 20 20  ef raised.      
2710: 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20        }.        
2720: 7d 0a 20 20 20 20 7d 0a 7d 0a 0a 0a 23 20 2d 2d  }.    }.}...# --
2730: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2740: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2750: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2760: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2770: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f  ----------.#  Co
2780: 6d 6d 61 6e 64 20 42 75 74 74 6f 6e 3a 3a 5f 6c  mmand Button::_l
2790: 65 61 76 65 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d  eave.# ---------
27a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
27b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
27c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
27d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
27e0: 2d 2d 2d 0a 70 72 6f 63 20 42 75 74 74 6f 6e 3a  ---.proc Button:
27f0: 3a 5f 6c 65 61 76 65 20 7b 20 70 61 74 68 20 7d  :_leave { path }
2800: 20 7b 0a 20 20 20 20 76 61 72 69 61 62 6c 65 20   {.    variable 
2810: 5f 63 75 72 72 65 6e 74 0a 20 20 20 20 76 61 72  _current.    var
2820: 69 61 62 6c 65 20 5f 70 72 65 73 73 65 64 0a 0a  iable _pressed..
2830: 20 20 20 20 73 65 74 20 5f 63 75 72 72 65 6e 74      set _current
2840: 20 22 22 0a 20 20 20 20 69 66 20 7b 20 21 5b 73   "".    if { ![s
2850: 74 72 69 6e 67 20 65 71 75 61 6c 20 5b 24 70 61  tring equal [$pa
2860: 74 68 3a 63 6d 64 20 63 67 65 74 20 2d 73 74 61  th:cmd cget -sta
2870: 74 65 5d 20 22 64 69 73 61 62 6c 65 64 22 5d 20  te] "disabled"] 
2880: 7d 20 7b 0a 20 20 20 20 20 20 20 20 24 70 61 74  } {.        $pat
2890: 68 3a 63 6d 64 20 63 6f 6e 66 69 67 75 72 65 20  h:cmd configure 
28a0: 2d 73 74 61 74 65 20 5b 57 69 64 67 65 74 3a 3a  -state [Widget::
28b0: 63 67 65 74 20 24 70 61 74 68 20 2d 73 74 61 74  cget $path -stat
28c0: 65 5d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 20  e].        if { 
28d0: 24 3a 3a 57 69 64 67 65 74 3a 3a 5f 74 68 65 6d  $::Widget::_them
28e0: 65 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 7d 20  e } {.        } 
28f0: 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20  else {.         
2900: 20 20 20 73 65 74 20 72 65 6c 69 65 66 20 5b 57     set relief [W
2910: 69 64 67 65 74 3a 3a 63 67 65 74 20 24 70 61 74  idget::cget $pat
2920: 68 20 2d 72 65 6c 69 65 66 5d 0a 20 20 20 20 20  h -relief].     
2930: 20 20 20 20 20 20 20 69 66 20 7b 20 24 5f 70 72         if { $_pr
2940: 65 73 73 65 64 20 3d 3d 20 24 70 61 74 68 20 7d  essed == $path }
2950: 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20   {.             
2960: 20 20 20 69 66 20 7b 20 5b 73 74 72 69 6e 67 20     if { [string 
2970: 65 71 75 61 6c 20 24 72 65 6c 69 65 66 20 22 6c  equal $relief "l
2980: 69 6e 6b 22 5d 20 7d 20 7b 0a 20 20 20 20 20 20  ink"] } {.      
2990: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 65                se
29a0: 74 20 72 65 6c 69 65 66 20 72 61 69 73 65 64 0a  t relief raised.
29b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
29c0: 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20  }.              
29d0: 20 20 24 70 61 74 68 3a 63 6d 64 20 63 6f 6e 66    $path:cmd conf
29e0: 69 67 75 72 65 20 2d 72 65 6c 69 65 66 20 24 72  igure -relief $r
29f0: 65 6c 69 65 66 0a 20 20 20 20 20 20 20 20 20 20  elief.          
2a00: 20 20 7d 20 65 6c 73 65 69 66 20 7b 20 5b 73 74    } elseif { [st
2a10: 72 69 6e 67 20 65 71 75 61 6c 20 24 72 65 6c 69  ring equal $reli
2a20: 65 66 20 22 6c 69 6e 6b 22 5d 20 7d 20 7b 0a 20  ef "link"] } {. 
2a30: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24                 $
2a40: 70 61 74 68 3a 63 6d 64 20 63 6f 6e 66 69 67 75  path:cmd configu
2a50: 72 65 20 2d 72 65 6c 69 65 66 20 66 6c 61 74 0a  re -relief flat.
2a60: 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20              }.  
2a70: 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 7d 0a        }.    }.}.
2a80: 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ..# ------------
2a90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2aa0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2ab0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2ac0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2ad0: 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 42 75 74 74  .#  Command Butt
2ae0: 6f 6e 3a 3a 5f 70 72 65 73 73 0a 23 20 2d 2d 2d  on::_press.# ---
2af0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2b30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 42  ---------.proc B
2b40: 75 74 74 6f 6e 3a 3a 5f 70 72 65 73 73 20 7b 20  utton::_press { 
2b50: 70 61 74 68 20 7d 20 7b 0a 20 20 20 20 76 61 72  path } {.    var
2b60: 69 61 62 6c 65 20 5f 70 72 65 73 73 65 64 0a 0a  iable _pressed..
2b70: 20 20 20 20 69 66 20 7b 20 21 5b 73 74 72 69 6e      if { ![strin
2b80: 67 20 65 71 75 61 6c 20 5b 24 70 61 74 68 3a 63  g equal [$path:c
2b90: 6d 64 20 63 67 65 74 20 2d 73 74 61 74 65 5d 20  md cget -state] 
2ba0: 22 64 69 73 61 62 6c 65 64 22 5d 20 7d 20 7b 0a  "disabled"] } {.
2bb0: 20 20 20 20 20 20 20 20 73 65 74 20 5f 70 72 65          set _pre
2bc0: 73 73 65 64 20 24 70 61 74 68 0a 20 20 20 20 20  ssed $path.     
2bd0: 20 20 20 69 66 20 7b 20 24 3a 3a 57 69 64 67 65     if { $::Widge
2be0: 74 3a 3a 5f 74 68 65 6d 65 7d 20 7b 0a 20 20 20  t::_theme} {.   
2bf0: 20 20 20 20 20 20 20 20 20 74 74 6b 3a 3a 63 6c           ttk::cl
2c00: 69 63 6b 54 6f 46 6f 63 75 73 20 24 70 61 74 68  ickToFocus $path
2c10: 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61  .            $pa
2c20: 74 68 20 73 74 61 74 65 20 70 72 65 73 73 65 64  th state pressed
2c30: 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20  .        } else 
2c40: 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70  {.            $p
2c50: 61 74 68 3a 63 6d 64 20 63 6f 6e 66 69 67 75 72  ath:cmd configur
2c60: 65 20 2d 72 65 6c 69 65 66 20 73 75 6e 6b 65 6e  e -relief sunken
2c70: 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20  .        }.     
2c80: 20 20 20 73 65 74 20 63 6d 64 20 5b 57 69 64 67     set cmd [Widg
2c90: 65 74 3a 3a 67 65 74 4d 65 67 61 77 69 64 67 65  et::getMegawidge
2ca0: 74 4f 70 74 69 6f 6e 20 24 70 61 74 68 20 2d 61  tOption $path -a
2cb0: 72 6d 63 6f 6d 6d 61 6e 64 5d 0a 20 20 20 20 20  rmcommand].     
2cc0: 20 20 20 69 66 20 7b 20 24 63 6d 64 20 21 3d 20     if { $cmd != 
2cd0: 22 22 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 20  "" } {.         
2ce0: 20 20 20 75 70 6c 65 76 65 6c 20 5c 23 30 20 24     uplevel \#0 $
2cf0: 63 6d 64 0a 09 20 20 20 20 73 65 74 20 72 65 70  cmd..    set rep
2d00: 65 61 74 64 65 6c 61 79 20 5b 57 69 64 67 65 74  eatdelay [Widget
2d10: 3a 3a 67 65 74 4d 65 67 61 77 69 64 67 65 74 4f  ::getMegawidgetO
2d20: 70 74 69 6f 6e 20 24 70 61 74 68 20 2d 72 65 70  ption $path -rep
2d30: 65 61 74 64 65 6c 61 79 5d 0a 09 20 20 20 20 73  eatdelay]..    s
2d40: 65 74 20 72 65 70 65 61 74 69 6e 74 20 5b 57 69  et repeatint [Wi
2d50: 64 67 65 74 3a 3a 67 65 74 4d 65 67 61 77 69 64  dget::getMegawid
2d60: 67 65 74 4f 70 74 69 6f 6e 20 24 70 61 74 68 20  getOption $path 
2d70: 2d 72 65 70 65 61 74 69 6e 74 65 72 76 61 6c 5d  -repeatinterval]
2d80: 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20  .            if 
2d90: 7b 20 24 72 65 70 65 61 74 64 65 6c 61 79 20 3e  { $repeatdelay >
2da0: 20 30 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 20   0 } {.         
2db0: 20 20 20 20 20 20 20 61 66 74 65 72 20 24 72 65         after $re
2dc0: 70 65 61 74 64 65 6c 61 79 20 22 42 75 74 74 6f  peatdelay "Butto
2dd0: 6e 3a 3a 5f 72 65 70 65 61 74 20 24 70 61 74 68  n::_repeat $path
2de0: 22 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20  ".            } 
2df0: 65 6c 73 65 69 66 20 7b 20 24 72 65 70 65 61 74  elseif { $repeat
2e00: 69 6e 74 20 3e 20 30 20 7d 20 7b 0a 20 20 20 20  int > 0 } {.    
2e10: 20 20 20 20 20 20 20 20 20 20 20 20 61 66 74 65              afte
2e20: 72 20 24 72 65 70 65 61 74 69 6e 74 20 22 42 75  r $repeatint "Bu
2e30: 74 74 6f 6e 3a 3a 5f 72 65 70 65 61 74 20 24 70  tton::_repeat $p
2e40: 61 74 68 22 0a 09 20 20 20 20 7d 0a 20 20 20 20  ath"..    }.    
2e50: 20 20 20 20 7d 0a 20 20 20 20 7d 0a 7d 0a 0a 0a      }.    }.}...
2e60: 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  # --------------
2e70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2e80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2e90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2ea0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
2eb0: 20 20 43 6f 6d 6d 61 6e 64 20 42 75 74 74 6f 6e    Command Button
2ec0: 3a 3a 5f 72 65 6c 65 61 73 65 0a 23 20 2d 2d 2d  ::_release.# ---
2ed0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2ee0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2ef0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2f00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2f10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 42  ---------.proc B
2f20: 75 74 74 6f 6e 3a 3a 5f 72 65 6c 65 61 73 65 20  utton::_release 
2f30: 7b 20 70 61 74 68 20 7d 20 7b 0a 20 20 20 20 76  { path } {.    v
2f40: 61 72 69 61 62 6c 65 20 5f 63 75 72 72 65 6e 74  ariable _current
2f50: 0a 20 20 20 20 76 61 72 69 61 62 6c 65 20 5f 70  .    variable _p
2f60: 72 65 73 73 65 64 0a 0a 20 20 20 20 69 66 20 7b  ressed..    if {
2f70: 20 24 5f 70 72 65 73 73 65 64 20 3d 3d 20 24 70   $_pressed == $p
2f80: 61 74 68 20 7d 20 7b 0a 20 20 20 20 20 20 20 20  ath } {.        
2f90: 73 65 74 20 5f 70 72 65 73 73 65 64 20 22 22 0a  set _pressed "".
2fa0: 09 61 66 74 65 72 20 63 61 6e 63 65 6c 20 22 42  .after cancel "B
2fb0: 75 74 74 6f 6e 3a 3a 5f 72 65 70 65 61 74 20 24  utton::_repeat $
2fc0: 70 61 74 68 22 0a 20 20 20 20 20 20 20 20 69 66  path".        if
2fd0: 20 7b 20 24 3a 3a 57 69 64 67 65 74 3a 3a 5f 74   { $::Widget::_t
2fe0: 68 65 6d 65 7d 20 7b 0a 20 20 20 20 20 20 20 20  heme} {.        
2ff0: 20 20 20 20 24 70 61 74 68 20 73 74 61 74 65 20      $path state 
3000: 21 70 72 65 73 73 65 64 0a 20 20 20 20 20 20 20  !pressed.       
3010: 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20   } else {.      
3020: 20 20 20 20 20 20 73 65 74 20 72 65 6c 69 65 66        set relief
3030: 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d 65 67   [Widget::getMeg
3040: 61 77 69 64 67 65 74 4f 70 74 69 6f 6e 20 24 70  awidgetOption $p
3050: 61 74 68 20 2d 72 65 6c 69 65 66 5d 0a 20 20 20  ath -relief].   
3060: 20 20 20 20 20 20 20 20 20 69 66 20 7b 20 5b 73           if { [s
3070: 74 72 69 6e 67 20 65 71 75 61 6c 20 24 72 65 6c  tring equal $rel
3080: 69 65 66 20 22 6c 69 6e 6b 22 5d 20 7d 20 7b 0a  ief "link"] } {.
3090: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
30a0: 73 65 74 20 72 65 6c 69 65 66 20 72 61 69 73 65  set relief raise
30b0: 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a  d.            }.
30c0: 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61 74              $pat
30d0: 68 3a 63 6d 64 20 63 6f 6e 66 69 67 75 72 65 20  h:cmd configure 
30e0: 2d 72 65 6c 69 65 66 20 24 72 65 6c 69 65 66 0a  -relief $relief.
30f0: 20 20 20 20 20 20 20 20 7d 0a 09 73 65 74 20 63          }..set c
3100: 6d 64 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d  md [Widget::getM
3110: 65 67 61 77 69 64 67 65 74 4f 70 74 69 6f 6e 20  egawidgetOption 
3120: 24 70 61 74 68 20 2d 64 69 73 61 72 6d 63 6f 6d  $path -disarmcom
3130: 6d 61 6e 64 5d 0a 20 20 20 20 20 20 20 20 69 66  mand].        if
3140: 20 7b 20 24 63 6d 64 20 21 3d 20 22 22 20 7d 20   { $cmd != "" } 
3150: 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 75 70  {.            up
3160: 6c 65 76 65 6c 20 5c 23 30 20 24 63 6d 64 0a 20  level \#0 $cmd. 
3170: 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20         }.       
3180: 20 69 66 20 7b 20 24 5f 63 75 72 72 65 6e 74 20   if { $_current 
3190: 3d 3d 20 24 70 61 74 68 20 26 26 0a 20 20 20 20  == $path &&.    
31a0: 20 20 20 20 20 20 20 20 20 21 5b 73 74 72 69 6e           ![strin
31b0: 67 20 65 71 75 61 6c 20 5b 24 70 61 74 68 3a 63  g equal [$path:c
31c0: 6d 64 20 63 67 65 74 20 2d 73 74 61 74 65 5d 20  md cget -state] 
31d0: 22 64 69 73 61 62 6c 65 64 22 5d 20 26 26 20 5c  "disabled"] && \
31e0: 0a 09 20 20 20 20 20 5b 73 65 74 20 63 6d 64 20  ..     [set cmd 
31f0: 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d 65 67 61  [Widget::getMega
3200: 77 69 64 67 65 74 4f 70 74 69 6f 6e 20 24 70 61  widgetOption $pa
3210: 74 68 20 2d 63 6f 6d 6d 61 6e 64 5d 5d 20 21 3d  th -command]] !=
3220: 20 22 22 20 7d 20 7b 0a 20 20 20 20 20 20 20 20   "" } {.        
3230: 20 20 20 20 75 70 6c 65 76 65 6c 20 5c 23 30 20      uplevel \#0 
3240: 24 63 6d 64 0a 20 20 20 20 20 20 20 20 7d 0a 20  $cmd.        }. 
3250: 20 20 20 7d 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d     }.}...# -----
3260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3280: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3290: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
32a0: 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61  -------.#  Comma
32b0: 6e 64 20 42 75 74 74 6f 6e 3a 3a 5f 72 65 70 65  nd Button::_repe
32c0: 61 74 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  at.# -----------
32d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
32e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
32f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3300: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
3310: 2d 0a 70 72 6f 63 20 42 75 74 74 6f 6e 3a 3a 5f  -.proc Button::_
3320: 72 65 70 65 61 74 20 7b 20 70 61 74 68 20 7d 20  repeat { path } 
3330: 7b 0a 20 20 20 20 76 61 72 69 61 62 6c 65 20 5f  {.    variable _
3340: 63 75 72 72 65 6e 74 0a 20 20 20 20 76 61 72 69  current.    vari
3350: 61 62 6c 65 20 5f 70 72 65 73 73 65 64 0a 0a 20  able _pressed.. 
3360: 20 20 20 69 66 20 7b 20 24 5f 63 75 72 72 65 6e     if { $_curren
3370: 74 20 3d 3d 20 24 70 61 74 68 20 26 26 20 24 5f  t == $path && $_
3380: 70 72 65 73 73 65 64 20 3d 3d 20 24 70 61 74 68  pressed == $path
3390: 20 26 26 0a 20 20 20 20 20 20 20 20 20 21 5b 73   &&.         ![s
33a0: 74 72 69 6e 67 20 65 71 75 61 6c 20 5b 24 70 61  tring equal [$pa
33b0: 74 68 3a 63 6d 64 20 63 67 65 74 20 2d 73 74 61  th:cmd cget -sta
33c0: 74 65 5d 20 22 64 69 73 61 62 6c 65 64 22 5d 20  te] "disabled"] 
33d0: 26 26 0a 20 20 20 20 20 20 20 20 20 5b 73 65 74  &&.         [set
33e0: 20 63 6d 64 20 5b 57 69 64 67 65 74 3a 3a 67 65   cmd [Widget::ge
33f0: 74 4d 65 67 61 77 69 64 67 65 74 4f 70 74 69 6f  tMegawidgetOptio
3400: 6e 20 24 70 61 74 68 20 2d 61 72 6d 63 6f 6d 6d  n $path -armcomm
3410: 61 6e 64 5d 5d 20 21 3d 20 22 22 20 7d 20 7b 0a  and]] != "" } {.
3420: 20 20 20 20 20 20 20 20 75 70 6c 65 76 65 6c 20          uplevel 
3430: 5c 23 30 20 24 63 6d 64 0a 20 20 20 20 7d 0a 20  \#0 $cmd.    }. 
3440: 20 20 20 69 66 20 7b 20 24 5f 70 72 65 73 73 65     if { $_presse
3450: 64 20 3d 3d 20 24 70 61 74 68 20 26 26 0a 20 20  d == $path &&.  
3460: 20 20 20 20 20 20 20 28 5b 73 65 74 20 64 65 6c         ([set del
3470: 61 79 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d  ay [Widget::getM
3480: 65 67 61 77 69 64 67 65 74 4f 70 74 69 6f 6e 20  egawidgetOption 
3490: 24 70 61 74 68 20 2d 72 65 70 65 61 74 69 6e 74  $path -repeatint
34a0: 65 72 76 61 6c 5d 5d 20 3e 30 20 7c 7c 0a 20 20  erval]] >0 ||.  
34b0: 20 20 20 20 20 20 20 20 5b 73 65 74 20 64 65 6c          [set del
34c0: 61 79 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 4d  ay [Widget::getM
34d0: 65 67 61 77 69 64 67 65 74 4f 70 74 69 6f 6e 20  egawidgetOption 
34e0: 24 70 61 74 68 20 2d 72 65 70 65 61 74 64 65 6c  $path -repeatdel
34f0: 61 79 5d 5d 20 3e 20 30 29 20 7d 20 7b 0a 20 20  ay]] > 0) } {.  
3500: 20 20 20 20 20 20 61 66 74 65 72 20 24 64 65 6c        after $del
3510: 61 79 20 22 42 75 74 74 6f 6e 3a 3a 5f 72 65 70  ay "Button::_rep
3520: 65 61 74 20 24 70 61 74 68 22 0a 20 20 20 20 7d  eat $path".    }
3530: 0a 7d 0a 0a                                      .}..