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 9c81b86c0fe68835384405e9ae86929a16b2d687:


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 73 63 72 6f 6c 6c 76 69 65 77 2e 74  .#  scrollview.t
0060: 63 6c 0a 23 20 20 54 68 69 73 20 66 69 6c 65 20  cl.#  This file 
0070: 69 73 20 70 61 72 74 20 6f 66 20 55 6e 69 66 69  is part of Unifi
0080: 78 20 42 57 69 64 67 65 74 20 54 6f 6f 6c 6b 69  x BWidget Toolki
0090: 74 0a 23 20 20 24 49 64 3a 20 73 63 72 6f 6c 6c  t.#  $Id: scroll
00a0: 76 69 65 77 2e 74 63 6c 2c 76 20 31 2e 31 2e 31  view.tcl,v 1.1.1
00b0: 2e 31 20 31 39 39 39 2f 30 38 2f 30 33 20 32 30  .1 1999/08/03 20
00c0: 3a 32 30 3a 32 33 20 65 72 69 63 6d 20 45 78 70  :20:23 ericm Exp
00d0: 20 24 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d   $.# -----------
00e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
00f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0100: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0110: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0120: 2d 2d 2d 0a 23 20 20 49 6e 64 65 78 20 6f 66 20  ---.#  Index of 
0130: 63 6f 6d 6d 61 6e 64 73 3a 0a 23 20 20 20 20 20  commands:.#     
0140: 2d 20 53 63 72 6f 6c 6c 65 64 57 69 6e 64 6f 77  - ScrolledWindow
0150: 3a 3a 63 72 65 61 74 65 0a 23 20 20 20 20 20 2d  ::create.#     -
0160: 20 53 63 72 6f 6c 6c 65 64 57 69 6e 64 6f 77 3a   ScrolledWindow:
0170: 3a 63 6f 6e 66 69 67 75 72 65 0a 23 20 20 20 20  :configure.#    
0180: 20 2d 20 53 63 72 6f 6c 6c 65 64 57 69 6e 64 6f   - ScrolledWindo
0190: 77 3a 3a 63 67 65 74 0a 23 20 20 20 20 20 2d 20  w::cget.#     - 
01a0: 53 63 72 6f 6c 6c 65 64 57 69 6e 64 6f 77 3a 3a  ScrolledWindow::
01b0: 5f 73 65 74 5f 68 73 63 72 6f 6c 6c 0a 23 20 20  _set_hscroll.#  
01c0: 20 20 20 2d 20 53 63 72 6f 6c 6c 65 64 57 69 6e     - ScrolledWin
01d0: 64 6f 77 3a 3a 5f 73 65 74 5f 76 73 63 72 6f 6c  dow::_set_vscrol
01e0: 6c 0a 23 20 20 20 20 20 2d 20 53 63 72 6f 6c 6c  l.#     - Scroll
01f0: 65 64 57 69 6e 64 6f 77 3a 3a 5f 75 70 64 61 74  edWindow::_updat
0200: 65 5f 73 63 72 6f 6c 6c 0a 23 20 20 20 20 20 2d  e_scroll.#     -
0210: 20 53 63 72 6f 6c 6c 65 64 57 69 6e 64 6f 77 3a   ScrolledWindow:
0220: 3a 5f 73 65 74 5f 76 69 65 77 0a 23 20 20 20 20  :_set_view.#    
0230: 20 2d 20 53 63 72 6f 6c 6c 65 64 57 69 6e 64 6f   - ScrolledWindo
0240: 77 3a 3a 5f 72 65 73 69 7a 65 0a 23 20 2d 2d 2d  w::_resize.# ---
0250: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0270: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0280: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0290: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 6e 61 6d  -----------..nam
02a0: 65 73 70 61 63 65 20 65 76 61 6c 20 53 63 72 6f  espace eval Scro
02b0: 6c 6c 56 69 65 77 20 7b 0a 20 20 20 20 57 69 64  llView {.    Wid
02c0: 67 65 74 3a 3a 64 65 63 6c 61 72 65 20 53 63 72  get::declare Scr
02d0: 6f 6c 6c 56 69 65 77 20 7b 0a 20 20 20 20 20 20  ollView {.      
02e0: 20 20 7b 2d 77 69 64 74 68 20 20 20 20 20 20 20    {-width       
02f0: 54 6b 52 65 73 6f 75 72 63 65 20 33 30 20 20 20  TkResource 30   
0300: 20 20 20 20 20 30 20 63 61 6e 76 61 73 7d 0a 20       0 canvas}. 
0310: 20 20 20 20 20 20 20 7b 2d 68 65 69 67 68 74 20         {-height 
0320: 20 20 20 20 20 54 6b 52 65 73 6f 75 72 63 65 20       TkResource 
0330: 33 30 20 20 20 20 20 20 20 20 30 20 63 61 6e 76  30        0 canv
0340: 61 73 7d 0a 20 20 20 20 20 20 20 20 7b 2d 62 61  as}.        {-ba
0350: 63 6b 67 72 6f 75 6e 64 20 20 54 6b 52 65 73 6f  ckground  TkReso
0360: 75 72 63 65 20 22 22 20 20 20 20 20 20 20 20 30  urce ""        0
0370: 20 63 61 6e 76 61 73 7d 0a 20 20 20 20 20 20 20   canvas}.       
0380: 20 7b 2d 66 6f 72 65 67 72 6f 75 6e 64 20 20 53   {-foreground  S
0390: 74 72 69 6e 67 20 20 20 20 20 62 6c 61 63 6b 20  tring     black 
03a0: 20 20 20 20 30 7d 0a 20 20 20 20 20 20 20 20 7b      0}.        {
03b0: 2d 66 69 6c 6c 20 20 20 20 20 20 20 20 53 74 72  -fill        Str
03c0: 69 6e 67 20 20 20 20 20 22 22 20 20 20 20 20 20  ing     ""      
03d0: 20 20 30 7d 0a 20 20 20 20 20 20 20 20 7b 2d 72    0}.        {-r
03e0: 65 6c 69 65 66 20 20 20 20 20 20 54 6b 52 65 73  elief      TkRes
03f0: 6f 75 72 63 65 20 66 6c 61 74 20 20 20 20 20 20  ource flat      
0400: 30 20 63 61 6e 76 61 73 7d 0a 20 20 20 20 20 20  0 canvas}.      
0410: 20 20 7b 2d 62 6f 72 64 65 72 77 69 64 74 68 20    {-borderwidth 
0420: 54 6b 52 65 73 6f 75 72 63 65 20 30 20 20 20 20  TkResource 0    
0430: 20 20 20 20 20 30 20 63 61 6e 76 61 73 7d 0a 20       0 canvas}. 
0440: 20 20 20 20 20 20 20 7b 2d 63 75 72 73 6f 72 20         {-cursor 
0450: 20 20 20 20 20 54 6b 52 65 73 6f 75 72 63 65 20       TkResource 
0460: 63 72 6f 73 73 68 61 69 72 20 30 20 63 61 6e 76  crosshair 0 canv
0470: 61 73 7d 0a 20 20 20 20 20 20 20 20 7b 2d 77 69  as}.        {-wi
0480: 6e 64 6f 77 20 20 20 20 20 20 53 74 72 69 6e 67  ndow      String
0490: 20 20 20 20 20 22 22 20 20 20 20 20 20 20 20 30       ""        0
04a0: 7d 0a 20 20 20 20 20 20 20 20 7b 2d 66 67 20 20  }.        {-fg  
04b0: 20 20 20 20 20 20 20 20 53 79 6e 6f 6e 79 6d 20          Synonym 
04c0: 20 20 20 2d 66 6f 72 65 67 72 6f 75 6e 64 7d 0a     -foreground}.
04d0: 20 20 20 20 20 20 20 20 7b 2d 62 67 20 20 20 20          {-bg    
04e0: 20 20 20 20 20 20 53 79 6e 6f 6e 79 6d 20 20 20        Synonym   
04f0: 20 2d 62 61 63 6b 67 72 6f 75 6e 64 7d 0a 20 20   -background}.  
0500: 20 20 20 20 20 20 7b 2d 62 64 20 20 20 20 20 20        {-bd      
0510: 20 20 20 20 53 79 6e 6f 6e 79 6d 20 20 20 20 2d      Synonym    -
0520: 62 6f 72 64 65 72 77 69 64 74 68 7d 0a 20 20 20  borderwidth}.   
0530: 20 7d 0a 0a 20 20 20 20 57 69 64 67 65 74 3a 3a   }..    Widget::
0540: 61 64 64 6d 61 70 20 53 63 72 6f 6c 6c 56 69 65  addmap ScrollVie
0550: 77 20 22 22 20 3a 63 6d 64 20 5c 0a 20 20 20 20  w "" :cmd \.    
0560: 20 20 20 20 7b 2d 72 65 6c 69 65 66 20 7b 7d 20      {-relief {} 
0570: 2d 62 6f 72 64 65 72 77 69 64 74 68 20 7b 7d 20  -borderwidth {} 
0580: 2d 62 61 63 6b 67 72 6f 75 6e 64 20 7b 7d 20 2d  -background {} -
0590: 77 69 64 74 68 20 7b 7d 20 2d 68 65 69 67 68 74  width {} -height
05a0: 20 7b 7d 20 2d 63 75 72 73 6f 72 20 7b 7d 7d 0a   {} -cursor {}}.
05b0: 0a 20 20 20 20 62 69 6e 64 20 42 77 53 63 72 6f  .    bind BwScro
05c0: 6c 6c 56 69 65 77 20 3c 42 75 74 74 6f 6e 50 72  llView <ButtonPr
05d0: 65 73 73 2d 33 3e 20 7b 53 63 72 6f 6c 6c 56 69  ess-3> {ScrollVi
05e0: 65 77 3a 3a 5f 73 65 74 5f 76 69 65 77 20 25 57  ew::_set_view %W
05f0: 20 73 65 74 20 25 78 20 25 79 7d 0a 20 20 20 20   set %x %y}.    
0600: 62 69 6e 64 20 42 77 53 63 72 6f 6c 6c 56 69 65  bind BwScrollVie
0610: 77 20 3c 42 75 74 74 6f 6e 50 72 65 73 73 2d 31  w <ButtonPress-1
0620: 3e 20 7b 53 63 72 6f 6c 6c 56 69 65 77 3a 3a 5f  > {ScrollView::_
0630: 73 65 74 5f 76 69 65 77 20 25 57 20 73 74 61 72  set_view %W star
0640: 74 20 25 78 20 25 79 7d 0a 20 20 20 20 62 69 6e  t %x %y}.    bin
0650: 64 20 42 77 53 63 72 6f 6c 6c 56 69 65 77 20 3c  d BwScrollView <
0660: 42 31 2d 4d 6f 74 69 6f 6e 3e 20 20 20 20 20 7b  B1-Motion>     {
0670: 53 63 72 6f 6c 6c 56 69 65 77 3a 3a 5f 73 65 74  ScrollView::_set
0680: 5f 76 69 65 77 20 25 57 20 6d 6f 74 69 6f 6e 20  _view %W motion 
0690: 25 78 20 25 79 7d 0a 20 20 20 20 62 69 6e 64 20  %x %y}.    bind 
06a0: 42 77 53 63 72 6f 6c 6c 56 69 65 77 20 3c 43 6f  BwScrollView <Co
06b0: 6e 66 69 67 75 72 65 3e 20 20 20 20 20 7b 53 63  nfigure>     {Sc
06c0: 72 6f 6c 6c 56 69 65 77 3a 3a 5f 72 65 73 69 7a  rollView::_resiz
06d0: 65 20 25 57 7d 0a 20 20 20 20 62 69 6e 64 20 42  e %W}.    bind B
06e0: 77 53 63 72 6f 6c 6c 56 69 65 77 20 3c 44 65 73  wScrollView <Des
06f0: 74 72 6f 79 3e 20 20 20 20 20 20 20 7b 53 63 72  troy>       {Scr
0700: 6f 6c 6c 56 69 65 77 3a 3a 5f 64 65 73 74 72 6f  ollView::_destro
0710: 79 20 25 57 7d 0a 0a 20 20 20 20 70 72 6f 63 20  y %W}..    proc 
0720: 3a 3a 53 63 72 6f 6c 6c 56 69 65 77 20 7b 20 70  ::ScrollView { p
0730: 61 74 68 20 61 72 67 73 20 7d 20 7b 20 72 65 74  ath args } { ret
0740: 75 72 6e 20 5b 65 76 61 6c 20 53 63 72 6f 6c 6c  urn [eval Scroll
0750: 56 69 65 77 3a 3a 63 72 65 61 74 65 20 24 70 61  View::create $pa
0760: 74 68 20 24 61 72 67 73 5d 20 7d 0a 20 20 20 20  th $args] }.    
0770: 70 72 6f 63 20 75 73 65 20 7b 7d 20 7b 7d 0a 0a  proc use {} {}..
0780: 20 20 20 20 76 61 72 69 61 62 6c 65 20 5f 77 69      variable _wi
0790: 64 67 65 74 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d  dget.}...# -----
07a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
07b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
07c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
07d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
07e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d  ---------.#  Com
07f0: 6d 61 6e 64 20 53 63 72 6f 6c 6c 56 69 65 77 3a  mand ScrollView:
0800: 3a 63 72 65 61 74 65 0a 23 20 2d 2d 2d 2d 2d 2d  :create.# ------
0810: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0820: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0830: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0840: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0850: 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 53 63  --------.proc Sc
0860: 72 6f 6c 6c 56 69 65 77 3a 3a 63 72 65 61 74 65  rollView::create
0870: 20 7b 20 70 61 74 68 20 61 72 67 73 20 7d 20 7b   { path args } {
0880: 0a 20 20 20 20 76 61 72 69 61 62 6c 65 20 5f 77  .    variable _w
0890: 69 64 67 65 74 0a 0a 20 20 20 20 57 69 64 67 65  idget..    Widge
08a0: 74 3a 3a 69 6e 69 74 20 53 63 72 6f 6c 6c 56 69  t::init ScrollVi
08b0: 65 77 20 24 70 61 74 68 20 24 61 72 67 73 0a 0a  ew $path $args..
08c0: 20 20 20 20 73 65 74 20 77 20 20 20 20 20 20 20      set w       
08d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 57                [W
08e0: 69 64 67 65 74 3a 3a 67 65 74 6f 70 74 69 6f 6e  idget::getoption
08f0: 20 24 70 61 74 68 20 2d 77 69 6e 64 6f 77 5d 0a   $path -window].
0900: 20 20 20 20 73 65 74 20 5f 77 69 64 67 65 74 28      set _widget(
0910: 24 70 61 74 68 2c 62 64 29 20 20 20 20 20 5b 57  $path,bd)     [W
0920: 69 64 67 65 74 3a 3a 67 65 74 6f 70 74 69 6f 6e  idget::getoption
0930: 20 24 70 61 74 68 20 2d 62 6f 72 64 65 72 77 69   $path -borderwi
0940: 64 74 68 5d 0a 20 20 20 20 73 65 74 20 5f 77 69  dth].    set _wi
0950: 64 67 65 74 28 24 70 61 74 68 2c 77 69 64 74 68  dget($path,width
0960: 29 20 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f  )  [Widget::geto
0970: 70 74 69 6f 6e 20 24 70 61 74 68 20 2d 77 69 64  ption $path -wid
0980: 74 68 5d 0a 20 20 20 20 73 65 74 20 5f 77 69 64  th].    set _wid
0990: 67 65 74 28 24 70 61 74 68 2c 68 65 69 67 68 74  get($path,height
09a0: 29 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70  ) [Widget::getop
09b0: 74 69 6f 6e 20 24 70 61 74 68 20 2d 68 65 69 67  tion $path -heig
09c0: 68 74 5d 0a 0a 20 20 20 20 69 66 20 7b 20 5b 77  ht]..    if { [w
09d0: 69 6e 66 6f 20 65 78 69 73 74 73 20 24 77 5d 20  info exists $w] 
09e0: 7d 20 7b 0a 20 20 20 20 20 20 20 20 73 65 74 20  } {.        set 
09f0: 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 6f 6c  _widget($path,ol
0a00: 64 78 73 63 72 6f 6c 6c 29 20 5b 24 77 20 63 67  dxscroll) [$w cg
0a10: 65 74 20 2d 78 73 63 72 6f 6c 6c 63 6f 6d 6d 61  et -xscrollcomma
0a20: 6e 64 5d 0a 20 20 20 20 20 20 20 20 73 65 74 20  nd].        set 
0a30: 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 6f 6c  _widget($path,ol
0a40: 64 79 73 63 72 6f 6c 6c 29 20 5b 24 77 20 63 67  dyscroll) [$w cg
0a50: 65 74 20 2d 79 73 63 72 6f 6c 6c 63 6f 6d 6d 61  et -yscrollcomma
0a60: 6e 64 5d 0a 20 20 20 20 20 20 20 20 24 77 20 63  nd].        $w c
0a70: 6f 6e 66 69 67 75 72 65 20 5c 0a 20 20 20 20 20  onfigure \.     
0a80: 20 20 20 20 20 20 20 2d 78 73 63 72 6f 6c 6c 63         -xscrollc
0a90: 6f 6d 6d 61 6e 64 20 22 53 63 72 6f 6c 6c 56 69  ommand "ScrollVi
0aa0: 65 77 3a 3a 5f 73 65 74 5f 68 73 63 72 6f 6c 6c  ew::_set_hscroll
0ab0: 20 24 70 61 74 68 22 20 5c 0a 20 20 20 20 20 20   $path" \.      
0ac0: 20 20 20 20 20 20 2d 79 73 63 72 6f 6c 6c 63 6f        -yscrollco
0ad0: 6d 6d 61 6e 64 20 22 53 63 72 6f 6c 6c 56 69 65  mmand "ScrollVie
0ae0: 77 3a 3a 5f 73 65 74 5f 76 73 63 72 6f 6c 6c 20  w::_set_vscroll 
0af0: 24 70 61 74 68 22 0a 20 20 20 20 7d 0a 20 20 20  $path".    }.   
0b00: 20 65 76 61 6c 20 63 61 6e 76 61 73 20 24 70 61   eval canvas $pa
0b10: 74 68 20 5b 57 69 64 67 65 74 3a 3a 73 75 62 63  th [Widget::subc
0b20: 67 65 74 20 24 70 61 74 68 20 3a 63 6d 64 5d 20  get $path :cmd] 
0b30: 2d 68 69 67 68 6c 69 67 68 74 74 68 69 63 6b 6e  -highlightthickn
0b40: 65 73 73 20 30 0a 20 20 20 20 24 70 61 74 68 20  ess 0.    $path 
0b50: 63 72 65 61 74 65 20 72 65 63 74 61 6e 67 6c 65  create rectangle
0b60: 20 2d 32 20 2d 32 20 2d 32 20 2d 32 20 5c 0a 20   -2 -2 -2 -2 \. 
0b70: 20 20 20 20 20 20 20 2d 66 69 6c 6c 20 20 20 20         -fill    
0b80: 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70 74 69  [Widget::getopti
0b90: 6f 6e 20 24 70 61 74 68 20 2d 66 69 6c 6c 5d 20  on $path -fill] 
0ba0: 20 20 20 20 20 20 5c 0a 20 20 20 20 20 20 20 20        \.        
0bb0: 2d 6f 75 74 6c 69 6e 65 20 5b 57 69 64 67 65 74  -outline [Widget
0bc0: 3a 3a 67 65 74 6f 70 74 69 6f 6e 20 24 70 61 74  ::getoption $pat
0bd0: 68 20 2d 66 6f 72 65 67 72 6f 75 6e 64 5d 20 5c  h -foreground] \
0be0: 0a 20 20 20 20 20 20 20 20 2d 74 61 67 73 20 20  .        -tags  
0bf0: 20 20 76 69 65 77 0a 0a 20 20 20 20 62 69 6e 64    view..    bind
0c00: 74 61 67 73 20 24 70 61 74 68 20 5b 6c 69 73 74  tags $path [list
0c10: 20 24 70 61 74 68 20 42 77 53 63 72 6f 6c 6c 56   $path BwScrollV
0c20: 69 65 77 20 5b 77 69 6e 66 6f 20 74 6f 70 6c 65  iew [winfo tople
0c30: 76 65 6c 20 24 70 61 74 68 5d 20 61 6c 6c 5d 0a  vel $path] all].
0c40: 0a 20 20 20 20 72 65 6e 61 6d 65 20 24 70 61 74  .    rename $pat
0c50: 68 20 3a 3a 24 70 61 74 68 3a 63 6d 64 0a 20 20  h ::$path:cmd.  
0c60: 20 20 70 72 6f 63 20 3a 3a 24 70 61 74 68 20 7b    proc ::$path {
0c70: 20 63 6d 64 20 61 72 67 73 20 7d 20 22 72 65 74   cmd args } "ret
0c80: 75 72 6e 20 5c 5b 65 76 61 6c 20 53 63 72 6f 6c  urn \[eval Scrol
0c90: 6c 56 69 65 77 3a 3a 5c 24 63 6d 64 20 24 70 61  lView::\$cmd $pa
0ca0: 74 68 20 5c 24 61 72 67 73 5c 5d 22 0a 0a 20 20  th \$args\]"..  
0cb0: 20 20 72 65 74 75 72 6e 20 24 70 61 74 68 0a 7d    return $path.}
0cc0: 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ...# -----------
0cd0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0ce0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0cf0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0d00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0d10: 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 53  ---.#  Command S
0d20: 63 72 6f 6c 6c 56 69 65 77 3a 3a 63 6f 6e 66 69  crollView::confi
0d30: 67 75 72 65 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d  gure.# ---------
0d40: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0d50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0d60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0d70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
0d80: 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 53 63 72 6f 6c  -----.proc Scrol
0d90: 6c 56 69 65 77 3a 3a 63 6f 6e 66 69 67 75 72 65  lView::configure
0da0: 20 7b 20 70 61 74 68 20 61 72 67 73 20 7d 20 7b   { path args } {
0db0: 0a 20 20 20 20 76 61 72 69 61 62 6c 65 20 5f 77  .    variable _w
0dc0: 69 64 67 65 74 0a 0a 20 20 20 20 73 65 74 20 6f  idget..    set o
0dd0: 6c 64 77 20 5b 57 69 64 67 65 74 3a 3a 67 65 74  ldw [Widget::get
0de0: 6f 70 74 69 6f 6e 20 24 70 61 74 68 20 2d 77 69  option $path -wi
0df0: 6e 64 6f 77 5d 20 0a 20 20 20 20 73 65 74 20 72  ndow] .    set r
0e00: 65 73 20 20 5b 57 69 64 67 65 74 3a 3a 63 6f 6e  es  [Widget::con
0e10: 66 69 67 75 72 65 20 24 70 61 74 68 20 24 61 72  figure $path $ar
0e20: 67 73 5d 0a 0a 20 20 20 20 69 66 20 7b 20 5b 57  gs]..    if { [W
0e30: 69 64 67 65 74 3a 3a 68 61 73 43 68 61 6e 67 65  idget::hasChange
0e40: 64 20 24 70 61 74 68 20 2d 77 69 6e 64 6f 77 20  d $path -window 
0e50: 77 5d 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 69  w] } {.        i
0e60: 66 20 7b 20 5b 77 69 6e 66 6f 20 65 78 69 73 74  f { [winfo exist
0e70: 73 20 24 6f 6c 64 77 5d 20 7d 20 7b 0a 20 20 20  s $oldw] } {.   
0e80: 20 20 20 20 20 20 20 20 20 24 6f 6c 64 77 20 63           $oldw c
0e90: 6f 6e 66 69 67 75 72 65 20 5c 0a 20 20 20 20 20  onfigure \.     
0ea0: 20 20 20 20 20 20 20 20 20 20 20 2d 78 73 63 72             -xscr
0eb0: 6f 6c 6c 63 6f 6d 6d 61 6e 64 20 24 5f 77 69 64  ollcommand $_wid
0ec0: 67 65 74 28 24 70 61 74 68 2c 6f 6c 64 78 73 63  get($path,oldxsc
0ed0: 72 6f 6c 6c 29 20 5c 0a 20 20 20 20 20 20 20 20  roll) \.        
0ee0: 20 20 20 20 20 20 20 20 2d 79 73 63 72 6f 6c 6c          -yscroll
0ef0: 63 6f 6d 6d 61 6e 64 20 24 5f 77 69 64 67 65 74  command $_widget
0f00: 28 24 70 61 74 68 2c 6f 6c 64 79 73 63 72 6f 6c  ($path,oldyscrol
0f10: 6c 29 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20  l).        }.   
0f20: 20 20 20 20 20 69 66 20 7b 20 5b 77 69 6e 66 6f       if { [winfo
0f30: 20 65 78 69 73 74 73 20 24 77 5d 20 7d 20 7b 0a   exists $w] } {.
0f40: 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20              set 
0f50: 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 6f 6c  _widget($path,ol
0f60: 64 78 73 63 72 6f 6c 6c 29 20 5b 24 77 20 63 67  dxscroll) [$w cg
0f70: 65 74 20 2d 78 73 63 72 6f 6c 6c 63 6f 6d 6d 61  et -xscrollcomma
0f80: 6e 64 5d 0a 20 20 20 20 20 20 20 20 20 20 20 20  nd].            
0f90: 73 65 74 20 5f 77 69 64 67 65 74 28 24 70 61 74  set _widget($pat
0fa0: 68 2c 6f 6c 64 79 73 63 72 6f 6c 6c 29 20 5b 24  h,oldyscroll) [$
0fb0: 77 20 63 67 65 74 20 2d 79 73 63 72 6f 6c 6c 63  w cget -yscrollc
0fc0: 6f 6d 6d 61 6e 64 5d 0a 20 20 20 20 20 20 20 20  ommand].        
0fd0: 20 20 20 20 24 77 20 63 6f 6e 66 69 67 75 72 65      $w configure
0fe0: 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20   \.             
0ff0: 20 20 20 2d 78 73 63 72 6f 6c 6c 63 6f 6d 6d 61     -xscrollcomma
1000: 6e 64 20 22 53 63 72 6f 6c 6c 56 69 65 77 3a 3a  nd "ScrollView::
1010: 5f 73 65 74 5f 68 73 63 72 6f 6c 6c 20 24 70 61  _set_hscroll $pa
1020: 74 68 22 20 5c 0a 20 20 20 20 20 20 20 20 20 20  th" \.          
1030: 20 20 20 20 20 20 2d 79 73 63 72 6f 6c 6c 63 6f        -yscrollco
1040: 6d 6d 61 6e 64 20 22 53 63 72 6f 6c 6c 56 69 65  mmand "ScrollVie
1050: 77 3a 3a 5f 73 65 74 5f 76 73 63 72 6f 6c 6c 20  w::_set_vscroll 
1060: 24 70 61 74 68 22 0a 20 20 20 20 20 20 20 20 7d  $path".        }
1070: 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20   else {.        
1080: 20 20 20 20 24 70 61 74 68 3a 63 6d 64 20 63 6f      $path:cmd co
1090: 6f 72 64 73 20 76 69 65 77 20 2d 32 20 2d 32 20  ords view -2 -2 
10a0: 2d 32 20 2d 32 0a 20 20 20 20 20 20 20 20 20 20  -2 -2.          
10b0: 20 20 73 65 74 20 5f 77 69 64 67 65 74 28 24 70    set _widget($p
10c0: 61 74 68 2c 6f 6c 64 78 73 63 72 6f 6c 6c 29 20  ath,oldxscroll) 
10d0: 7b 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73  {}.            s
10e0: 65 74 20 5f 77 69 64 67 65 74 28 24 70 61 74 68  et _widget($path
10f0: 2c 6f 6c 64 79 73 63 72 6f 6c 6c 29 20 7b 7d 0a  ,oldyscroll) {}.
1100: 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a          }.    }.
1110: 0a 20 20 20 20 69 66 20 7b 20 5b 57 69 64 67 65  .    if { [Widge
1120: 74 3a 3a 68 61 73 43 68 61 6e 67 65 64 20 24 70  t::hasChanged $p
1130: 61 74 68 20 2d 66 69 6c 6c 20 66 69 6c 6c 5d 20  ath -fill fill] 
1140: 7c 0a 20 20 20 20 20 20 20 20 20 5b 57 69 64 67  |.         [Widg
1150: 65 74 3a 3a 68 61 73 43 68 61 6e 67 65 64 20 24  et::hasChanged $
1160: 70 61 74 68 20 2d 66 6f 72 65 67 72 6f 75 6e 64  path -foreground
1170: 20 66 67 5d 20 7d 20 7b 0a 20 20 20 20 20 20 20   fg] } {.       
1180: 20 24 70 61 74 68 3a 63 6d 64 20 69 74 65 6d 63   $path:cmd itemc
1190: 6f 6e 66 69 67 75 72 65 20 76 69 65 77 20 5c 0a  onfigure view \.
11a0: 20 20 20 20 20 20 20 20 20 20 20 20 2d 66 69 6c              -fil
11b0: 6c 20 20 20 20 24 66 69 6c 6c 20 5c 0a 20 20 20  l    $fill \.   
11c0: 20 20 20 20 20 20 20 20 20 2d 6f 75 74 6c 69 6e           -outlin
11d0: 65 20 24 66 67 0a 20 20 20 20 7d 0a 0a 20 20 20  e $fg.    }..   
11e0: 20 72 65 74 75 72 6e 20 24 72 65 73 0a 7d 0a 0a   return $res.}..
11f0: 0a 23 20 2d 2d 2d 2d 2d 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 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 53 63 72  -.#  Command Scr
1250: 6f 6c 6c 56 69 65 77 3a 3a 63 67 65 74 0a 23 20  ollView::cget.# 
1260: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
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 0a 70  --------------.p
12b0: 72 6f 63 20 53 63 72 6f 6c 6c 56 69 65 77 3a 3a  roc ScrollView::
12c0: 63 67 65 74 20 7b 20 70 61 74 68 20 6f 70 74 69  cget { path opti
12d0: 6f 6e 20 7d 20 7b 0a 20 20 20 20 72 65 74 75 72  on } {.    retur
12e0: 6e 20 5b 57 69 64 67 65 74 3a 3a 63 67 65 74 20  n [Widget::cget 
12f0: 24 70 61 74 68 20 24 6f 70 74 69 6f 6e 5d 0a 7d  $path $option].}
1300: 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ...# -----------
1310: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1320: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1330: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1340: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1350: 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 53  ---.#  Command S
1360: 63 72 6f 6c 6c 56 69 65 77 3a 3a 5f 64 65 73 74  crollView::_dest
1370: 72 6f 79 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  roy.# ----------
1380: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1390: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
13c0: 2d 2d 2d 2d 0a 70 72 6f 63 20 53 63 72 6f 6c 6c  ----.proc Scroll
13d0: 56 69 65 77 3a 3a 5f 64 65 73 74 72 6f 79 20 7b  View::_destroy {
13e0: 20 70 61 74 68 20 7d 20 7b 0a 20 20 20 20 76 61   path } {.    va
13f0: 72 69 61 62 6c 65 20 5f 77 69 64 67 65 74 0a 0a  riable _widget..
1400: 20 20 20 20 73 65 74 20 77 20 5b 57 69 64 67 65      set w [Widge
1410: 74 3a 3a 67 65 74 6f 70 74 69 6f 6e 20 24 70 61  t::getoption $pa
1420: 74 68 20 2d 77 69 6e 64 6f 77 5d 20 0a 20 20 20  th -window] .   
1430: 20 69 66 20 7b 20 5b 77 69 6e 66 6f 20 65 78 69   if { [winfo exi
1440: 73 74 73 20 24 77 5d 20 7d 20 7b 0a 20 20 20 20  sts $w] } {.    
1450: 20 20 20 20 24 77 20 63 6f 6e 66 69 67 75 72 65      $w configure
1460: 20 5c 0a 20 20 20 20 20 20 20 20 20 20 20 20 2d   \.            -
1470: 78 73 63 72 6f 6c 6c 63 6f 6d 6d 61 6e 64 20 24  xscrollcommand $
1480: 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 6f 6c  _widget($path,ol
1490: 64 78 73 63 72 6f 6c 6c 29 20 5c 0a 20 20 20 20  dxscroll) \.    
14a0: 20 20 20 20 20 20 20 20 2d 79 73 63 72 6f 6c 6c          -yscroll
14b0: 63 6f 6d 6d 61 6e 64 20 24 5f 77 69 64 67 65 74  command $_widget
14c0: 28 24 70 61 74 68 2c 6f 6c 64 79 73 63 72 6f 6c  ($path,oldyscrol
14d0: 6c 29 0a 20 20 20 20 7d 0a 20 20 20 20 75 6e 73  l).    }.    uns
14e0: 65 74 20 5f 77 69 64 67 65 74 28 24 70 61 74 68  et _widget($path
14f0: 2c 6f 6c 64 78 73 63 72 6f 6c 6c 29 0a 20 20 20  ,oldxscroll).   
1500: 20 75 6e 73 65 74 20 5f 77 69 64 67 65 74 28 24   unset _widget($
1510: 70 61 74 68 2c 6f 6c 64 79 73 63 72 6f 6c 6c 29  path,oldyscroll)
1520: 0a 20 20 20 20 75 6e 73 65 74 20 5f 77 69 64 67  .    unset _widg
1530: 65 74 28 24 70 61 74 68 2c 62 64 29 0a 20 20 20  et($path,bd).   
1540: 20 75 6e 73 65 74 20 5f 77 69 64 67 65 74 28 24   unset _widget($
1550: 70 61 74 68 2c 77 69 64 74 68 29 0a 20 20 20 20  path,width).    
1560: 75 6e 73 65 74 20 5f 77 69 64 67 65 74 28 24 70  unset _widget($p
1570: 61 74 68 2c 68 65 69 67 68 74 29 0a 20 20 20 20  ath,height).    
1580: 63 61 74 63 68 20 7b 75 6e 73 65 74 20 5f 77 69  catch {unset _wi
1590: 64 67 65 74 28 24 70 61 74 68 2c 64 78 29 7d 0a  dget($path,dx)}.
15a0: 20 20 20 20 63 61 74 63 68 20 7b 75 6e 73 65 74      catch {unset
15b0: 20 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 64   _widget($path,d
15c0: 79 29 7d 0a 20 20 20 20 57 69 64 67 65 74 3a 3a  y)}.    Widget::
15d0: 64 65 73 74 72 6f 79 20 24 70 61 74 68 0a 20 20  destroy $path.  
15e0: 20 20 72 65 6e 61 6d 65 20 24 70 61 74 68 20 7b    rename $path {
15f0: 7d 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d  }.}...# --------
1600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1610: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1620: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1630: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1640: 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d 6d 61 6e  ------.#  Comman
1650: 64 20 53 63 72 6f 6c 6c 56 69 65 77 3a 3a 5f 73  d ScrollView::_s
1660: 65 74 5f 68 73 63 72 6f 6c 6c 0a 23 20 2d 2d 2d  et_hscroll.# ---
1670: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1680: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1690: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
16b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63  -----------.proc
16c0: 20 53 63 72 6f 6c 6c 56 69 65 77 3a 3a 5f 73 65   ScrollView::_se
16d0: 74 5f 68 73 63 72 6f 6c 6c 20 7b 20 70 61 74 68  t_hscroll { path
16e0: 20 76 6d 69 6e 20 76 6d 61 78 20 7d 20 7b 0a 20   vmin vmax } {. 
16f0: 20 20 20 76 61 72 69 61 62 6c 65 20 5f 77 69 64     variable _wid
1700: 67 65 74 0a 0a 20 20 20 20 73 65 74 20 63 20 20  get..    set c  
1710: 5b 24 70 61 74 68 3a 63 6d 64 20 63 6f 6f 72 64  [$path:cmd coord
1720: 73 20 76 69 65 77 5d 0a 20 20 20 20 73 65 74 20  s view].    set 
1730: 78 30 20 5b 65 78 70 72 20 7b 24 76 6d 69 6e 2a  x0 [expr {$vmin*
1740: 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 77  $_widget($path,w
1750: 69 64 74 68 29 2b 24 5f 77 69 64 67 65 74 28 24  idth)+$_widget($
1760: 70 61 74 68 2c 62 64 29 7d 5d 0a 20 20 20 20 73  path,bd)}].    s
1770: 65 74 20 78 31 20 5b 65 78 70 72 20 7b 24 76 6d  et x1 [expr {$vm
1780: 61 78 2a 24 5f 77 69 64 67 65 74 28 24 70 61 74  ax*$_widget($pat
1790: 68 2c 77 69 64 74 68 29 2b 24 5f 77 69 64 67 65  h,width)+$_widge
17a0: 74 28 24 70 61 74 68 2c 62 64 29 2d 31 7d 5d 0a  t($path,bd)-1}].
17b0: 20 20 20 20 24 70 61 74 68 3a 63 6d 64 20 63 6f      $path:cmd co
17c0: 6f 72 64 73 20 76 69 65 77 20 24 78 30 20 5b 6c  ords view $x0 [l
17d0: 69 6e 64 65 78 20 24 63 20 31 5d 20 24 78 31 20  index $c 1] $x1 
17e0: 5b 6c 69 6e 64 65 78 20 24 63 20 33 5d 0a 20 20  [lindex $c 3].  
17f0: 20 20 69 66 20 7b 20 24 5f 77 69 64 67 65 74 28    if { $_widget(
1800: 24 70 61 74 68 2c 6f 6c 64 78 73 63 72 6f 6c 6c  $path,oldxscroll
1810: 29 20 21 3d 20 22 22 20 7d 20 7b 0a 20 20 20 20  ) != "" } {.    
1820: 20 20 20 20 75 70 6c 65 76 65 6c 20 5c 23 30 20      uplevel \#0 
1830: 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 6f  $_widget($path,o
1840: 6c 64 78 73 63 72 6f 6c 6c 29 20 24 76 6d 69 6e  ldxscroll) $vmin
1850: 20 24 76 6d 61 78 0a 20 20 20 20 7d 0a 7d 0a 0a   $vmax.    }.}..
1860: 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .# -------------
1870: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1880: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1890: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18b0: 2d 0a 23 20 20 43 6f 6d 6d 61 6e 64 20 53 63 72  -.#  Command Scr
18c0: 6f 6c 6c 56 69 65 77 3a 3a 5f 73 65 74 5f 76 73  ollView::_set_vs
18d0: 63 72 6f 6c 6c 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d  croll.# --------
18e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
18f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1900: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1910: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1920: 2d 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 53 63 72 6f  ------.proc Scro
1930: 6c 6c 56 69 65 77 3a 3a 5f 73 65 74 5f 76 73 63  llView::_set_vsc
1940: 72 6f 6c 6c 20 7b 20 70 61 74 68 20 76 6d 69 6e  roll { path vmin
1950: 20 76 6d 61 78 20 7d 20 7b 0a 20 20 20 20 76 61   vmax } {.    va
1960: 72 69 61 62 6c 65 20 5f 77 69 64 67 65 74 0a 0a  riable _widget..
1970: 20 20 20 20 73 65 74 20 63 20 20 5b 24 70 61 74      set c  [$pat
1980: 68 3a 63 6d 64 20 63 6f 6f 72 64 73 20 76 69 65  h:cmd coords vie
1990: 77 5d 0a 20 20 20 20 73 65 74 20 79 30 20 5b 65  w].    set y0 [e
19a0: 78 70 72 20 7b 24 76 6d 69 6e 2a 24 5f 77 69 64  xpr {$vmin*$_wid
19b0: 67 65 74 28 24 70 61 74 68 2c 68 65 69 67 68 74  get($path,height
19c0: 29 2b 24 5f 77 69 64 67 65 74 28 24 70 61 74 68  )+$_widget($path
19d0: 2c 62 64 29 7d 5d 0a 20 20 20 20 73 65 74 20 79  ,bd)}].    set y
19e0: 31 20 5b 65 78 70 72 20 7b 24 76 6d 61 78 2a 24  1 [expr {$vmax*$
19f0: 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 68 65  _widget($path,he
1a00: 69 67 68 74 29 2b 24 5f 77 69 64 67 65 74 28 24  ight)+$_widget($
1a10: 70 61 74 68 2c 62 64 29 2d 31 7d 5d 0a 20 20 20  path,bd)-1}].   
1a20: 20 24 70 61 74 68 3a 63 6d 64 20 63 6f 6f 72 64   $path:cmd coord
1a30: 73 20 76 69 65 77 20 5b 6c 69 6e 64 65 78 20 24  s view [lindex $
1a40: 63 20 30 5d 20 24 79 30 20 5b 6c 69 6e 64 65 78  c 0] $y0 [lindex
1a50: 20 24 63 20 32 5d 20 24 79 31 0a 20 20 20 20 69   $c 2] $y1.    i
1a60: 66 20 7b 20 24 5f 77 69 64 67 65 74 28 24 70 61  f { $_widget($pa
1a70: 74 68 2c 6f 6c 64 79 73 63 72 6f 6c 6c 29 20 21  th,oldyscroll) !
1a80: 3d 20 22 22 20 7d 20 7b 0a 20 20 20 20 20 20 20  = "" } {.       
1a90: 20 75 70 6c 65 76 65 6c 20 5c 23 30 20 24 5f 77   uplevel \#0 $_w
1aa0: 69 64 67 65 74 28 24 70 61 74 68 2c 6f 6c 64 79  idget($path,oldy
1ab0: 73 63 72 6f 6c 6c 29 20 24 76 6d 69 6e 20 24 76  scroll) $vmin $v
1ac0: 6d 61 78 0a 20 20 20 20 7d 0a 7d 0a 0a 0a 23 20  max.    }.}...# 
1ad0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1ae0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1af0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23  --------------.#
1b20: 20 20 43 6f 6d 6d 61 6e 64 20 53 63 72 6f 6c 6c    Command Scroll
1b30: 56 69 65 77 3a 3a 5f 75 70 64 61 74 65 5f 73 63  View::_update_sc
1b40: 72 6f 6c 6c 0a 23 20 2d 2d 2d 2d 2d 2d 2d 2d 2d  roll.# ---------
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: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1b90: 2d 2d 2d 2d 2d 0a 70 72 6f 63 20 53 63 72 6f 6c  -----.proc Scrol
1ba0: 6c 56 69 65 77 3a 3a 5f 75 70 64 61 74 65 5f 73  lView::_update_s
1bb0: 63 72 6f 6c 6c 20 7b 20 70 61 74 68 20 63 61 6c  croll { path cal
1bc0: 6c 73 63 72 6f 6c 6c 20 68 6d 69 6e 6d 61 78 20  lscroll hminmax 
1bd0: 76 6d 69 6e 6d 61 78 20 7d 20 7b 0a 20 20 20 20  vminmax } {.    
1be0: 76 61 72 69 61 62 6c 65 20 5f 77 69 64 67 65 74  variable _widget
1bf0: 0a 0a 20 20 20 20 73 65 74 20 63 20 20 20 20 5b  ..    set c    [
1c00: 24 70 61 74 68 3a 63 6d 64 20 63 6f 6f 72 64 73  $path:cmd coords
1c10: 20 76 69 65 77 5d 0a 20 20 20 20 73 65 74 20 68   view].    set h
1c20: 6d 69 6e 20 5b 6c 69 6e 64 65 78 20 24 68 6d 69  min [lindex $hmi
1c30: 6e 6d 61 78 20 30 5d 0a 20 20 20 20 73 65 74 20  nmax 0].    set 
1c40: 68 6d 61 78 20 5b 6c 69 6e 64 65 78 20 24 68 6d  hmax [lindex $hm
1c50: 69 6e 6d 61 78 20 31 5d 0a 20 20 20 20 73 65 74  inmax 1].    set
1c60: 20 76 6d 69 6e 20 5b 6c 69 6e 64 65 78 20 24 76   vmin [lindex $v
1c70: 6d 69 6e 6d 61 78 20 30 5d 0a 20 20 20 20 73 65  minmax 0].    se
1c80: 74 20 76 6d 61 78 20 5b 6c 69 6e 64 65 78 20 24  t vmax [lindex $
1c90: 76 6d 69 6e 6d 61 78 20 31 5d 0a 20 20 20 20 73  vminmax 1].    s
1ca0: 65 74 20 78 30 20 20 20 5b 65 78 70 72 20 7b 24  et x0   [expr {$
1cb0: 68 6d 69 6e 2a 24 5f 77 69 64 67 65 74 28 24 70  hmin*$_widget($p
1cc0: 61 74 68 2c 77 69 64 74 68 29 2b 24 5f 77 69 64  ath,width)+$_wid
1cd0: 67 65 74 28 24 70 61 74 68 2c 62 64 29 7d 5d 0a  get($path,bd)}].
1ce0: 20 20 20 20 73 65 74 20 78 31 20 20 20 5b 65 78      set x1   [ex
1cf0: 70 72 20 7b 24 68 6d 61 78 2a 24 5f 77 69 64 67  pr {$hmax*$_widg
1d00: 65 74 28 24 70 61 74 68 2c 77 69 64 74 68 29 2b  et($path,width)+
1d10: 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 62  $_widget($path,b
1d20: 64 29 2d 31 7d 5d 0a 20 20 20 20 73 65 74 20 79  d)-1}].    set y
1d30: 30 20 20 20 5b 65 78 70 72 20 7b 24 76 6d 69 6e  0   [expr {$vmin
1d40: 2a 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c  *$_widget($path,
1d50: 68 65 69 67 68 74 29 2b 24 5f 77 69 64 67 65 74  height)+$_widget
1d60: 28 24 70 61 74 68 2c 62 64 29 7d 5d 0a 20 20 20  ($path,bd)}].   
1d70: 20 73 65 74 20 79 31 20 20 20 5b 65 78 70 72 20   set y1   [expr 
1d80: 7b 24 76 6d 61 78 2a 24 5f 77 69 64 67 65 74 28  {$vmax*$_widget(
1d90: 24 70 61 74 68 2c 68 65 69 67 68 74 29 2b 24 5f  $path,height)+$_
1da0: 77 69 64 67 65 74 28 24 70 61 74 68 2c 62 64 29  widget($path,bd)
1db0: 2d 31 7d 5d 0a 20 20 20 20 24 70 61 74 68 3a 63  -1}].    $path:c
1dc0: 6d 64 20 63 6f 6f 72 64 73 20 76 69 65 77 20 24  md coords view $
1dd0: 78 30 20 24 79 30 20 24 78 31 20 24 79 31 0a 20  x0 $y0 $x1 $y1. 
1de0: 20 20 20 69 66 20 7b 20 24 63 61 6c 6c 73 63 72     if { $callscr
1df0: 6f 6c 6c 20 7d 20 7b 0a 20 20 20 20 20 20 20 20  oll } {.        
1e00: 69 66 20 7b 20 24 5f 77 69 64 67 65 74 28 24 70  if { $_widget($p
1e10: 61 74 68 2c 6f 6c 64 78 73 63 72 6f 6c 6c 29 20  ath,oldxscroll) 
1e20: 21 3d 20 22 22 20 7d 20 7b 0a 20 20 20 20 20 20  != "" } {.      
1e30: 20 20 20 20 20 20 75 70 6c 65 76 65 6c 20 5c 23        uplevel \#
1e40: 30 20 24 5f 77 69 64 67 65 74 28 24 70 61 74 68  0 $_widget($path
1e50: 2c 6f 6c 64 78 73 63 72 6f 6c 6c 29 20 24 68 6d  ,oldxscroll) $hm
1e60: 69 6e 20 24 68 6d 61 78 0a 20 20 20 20 20 20 20  in $hmax.       
1e70: 20 7d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 20   }.        if { 
1e80: 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 6f  $_widget($path,o
1e90: 6c 64 79 73 63 72 6f 6c 6c 29 20 21 3d 20 22 22  ldyscroll) != ""
1ea0: 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20   } {.           
1eb0: 20 75 70 6c 65 76 65 6c 20 5c 23 30 20 24 5f 77   uplevel \#0 $_w
1ec0: 69 64 67 65 74 28 24 70 61 74 68 2c 6f 6c 64 79  idget($path,oldy
1ed0: 73 63 72 6f 6c 6c 29 20 24 76 6d 69 6e 20 24 76  scroll) $vmin $v
1ee0: 6d 61 78 0a 20 20 20 20 20 20 20 20 7d 0a 20 20  max.        }.  
1ef0: 20 20 7d 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d 2d    }.}...# ------
1f00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f30: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f40: 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d 6d  --------.#  Comm
1f50: 61 6e 64 20 53 63 72 6f 6c 6c 56 69 65 77 3a 3a  and ScrollView::
1f60: 5f 73 65 74 5f 76 69 65 77 0a 23 20 2d 2d 2d 2d  _set_view.# ----
1f70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1f90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
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 0a 70 72 6f 63 20  ----------.proc 
1fc0: 53 63 72 6f 6c 6c 56 69 65 77 3a 3a 5f 73 65 74  ScrollView::_set
1fd0: 5f 76 69 65 77 20 7b 20 70 61 74 68 20 63 6d 64  _view { path cmd
1fe0: 20 78 20 79 20 7d 20 7b 0a 20 20 20 20 76 61 72   x y } {.    var
1ff0: 69 61 62 6c 65 20 5f 77 69 64 67 65 74 0a 0a 20  iable _widget.. 
2000: 20 20 20 73 65 74 20 77 20 5b 57 69 64 67 65 74     set w [Widget
2010: 3a 3a 67 65 74 6f 70 74 69 6f 6e 20 24 70 61 74  ::getoption $pat
2020: 68 20 2d 77 69 6e 64 6f 77 5d 0a 20 20 20 20 69  h -window].    i
2030: 66 20 7b 20 5b 77 69 6e 66 6f 20 65 78 69 73 74  f { [winfo exist
2040: 73 20 24 77 5d 20 7d 20 7b 0a 20 20 20 20 20 20  s $w] } {.      
2050: 20 20 69 66 20 7b 20 21 5b 73 74 72 69 6e 67 20    if { ![string 
2060: 63 6f 6d 70 61 72 65 20 24 63 6d 64 20 22 73 74  compare $cmd "st
2070: 61 72 74 22 5d 20 7d 20 7b 0a 20 20 20 20 20 20  art"] } {.      
2080: 20 20 20 20 20 20 73 65 74 20 63 20 20 5b 24 70        set c  [$p
2090: 61 74 68 3a 63 6d 64 20 63 6f 6f 72 64 73 20 76  ath:cmd coords v
20a0: 69 65 77 5d 0a 20 20 20 20 20 20 20 20 20 20 20  iew].           
20b0: 20 73 65 74 20 78 30 20 5b 6c 69 6e 64 65 78 20   set x0 [lindex 
20c0: 24 63 20 30 5d 0a 20 20 20 20 20 20 20 20 20 20  $c 0].          
20d0: 20 20 73 65 74 20 79 30 20 5b 6c 69 6e 64 65 78    set y0 [lindex
20e0: 20 24 63 20 31 5d 0a 20 20 20 20 20 20 20 20 20   $c 1].         
20f0: 20 20 20 73 65 74 20 5f 77 69 64 67 65 74 28 24     set _widget($
2100: 70 61 74 68 2c 64 78 29 20 5b 65 78 70 72 20 7b  path,dx) [expr {
2110: 24 78 2d 24 78 30 7d 5d 0a 20 20 20 20 20 20 20  $x-$x0}].       
2120: 20 20 20 20 20 73 65 74 20 5f 77 69 64 67 65 74       set _widget
2130: 28 24 70 61 74 68 2c 64 79 29 20 5b 65 78 70 72  ($path,dy) [expr
2140: 20 7b 24 79 2d 24 79 30 7d 5d 0a 20 20 20 20 20   {$y-$y0}].     
2150: 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20     } else {.    
2160: 20 20 20 20 20 20 20 20 69 66 20 7b 20 21 5b 73          if { ![s
2170: 74 72 69 6e 67 20 63 6f 6d 70 61 72 65 20 24 63  tring compare $c
2180: 6d 64 20 22 6d 6f 74 69 6f 6e 22 5d 20 7d 20 7b  md "motion"] } {
2190: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20  .               
21a0: 20 73 65 74 20 76 68 20 5b 65 78 70 72 20 7b 64   set vh [expr {d
21b0: 6f 75 62 6c 65 28 24 78 2d 24 5f 77 69 64 67 65  ouble($x-$_widge
21c0: 74 28 24 70 61 74 68 2c 64 78 29 2d 24 5f 77 69  t($path,dx)-$_wi
21d0: 64 67 65 74 28 24 70 61 74 68 2c 62 64 29 29 2f  dget($path,bd))/
21e0: 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 77  $_widget($path,w
21f0: 69 64 74 68 29 7d 5d 0a 20 20 20 20 20 20 20 20  idth)}].        
2200: 20 20 20 20 20 20 20 20 73 65 74 20 76 76 20 5b          set vv [
2210: 65 78 70 72 20 7b 64 6f 75 62 6c 65 28 24 79 2d  expr {double($y-
2220: 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 64  $_widget($path,d
2230: 79 29 2d 24 5f 77 69 64 67 65 74 28 24 70 61 74  y)-$_widget($pat
2240: 68 2c 62 64 29 29 2f 24 5f 77 69 64 67 65 74 28  h,bd))/$_widget(
2250: 24 70 61 74 68 2c 68 65 69 67 68 74 29 7d 5d 0a  $path,height)}].
2260: 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c              } el
2270: 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20  se {.           
2280: 20 20 20 20 20 73 65 74 20 76 68 20 5b 65 78 70       set vh [exp
2290: 72 20 7b 64 6f 75 62 6c 65 28 24 78 2d 24 5f 77  r {double($x-$_w
22a0: 69 64 67 65 74 28 24 70 61 74 68 2c 62 64 29 29  idget($path,bd))
22b0: 2f 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c  /$_widget($path,
22c0: 77 69 64 74 68 29 7d 5d 0a 20 20 20 20 20 20 20  width)}].       
22d0: 20 20 20 20 20 20 20 20 20 73 65 74 20 76 76 20           set vv 
22e0: 5b 65 78 70 72 20 7b 64 6f 75 62 6c 65 28 24 79  [expr {double($y
22f0: 2d 24 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c  -$_widget($path,
2300: 62 64 29 29 2f 24 5f 77 69 64 67 65 74 28 24 70  bd))/$_widget($p
2310: 61 74 68 2c 68 65 69 67 68 74 29 7d 5d 0a 20 20  ath,height)}].  
2320: 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20            }.    
2330: 20 20 20 20 20 20 20 20 24 77 20 78 76 69 65 77          $w xview
2340: 20 6d 6f 76 65 74 6f 20 24 76 68 0a 20 20 20 20   moveto $vh.    
2350: 20 20 20 20 20 20 20 20 24 77 20 79 76 69 65 77          $w yview
2360: 20 6d 6f 76 65 74 6f 20 24 76 76 0a 20 20 20 20   moveto $vv.    
2370: 20 20 20 20 20 20 20 20 5f 75 70 64 61 74 65 5f          _update_
2380: 73 63 72 6f 6c 6c 20 24 70 61 74 68 20 31 20 5b  scroll $path 1 [
2390: 24 77 20 78 76 69 65 77 5d 20 5b 24 77 20 79 76  $w xview] [$w yv
23a0: 69 65 77 5d 0a 20 20 20 20 20 20 20 20 7d 0a 20  iew].        }. 
23b0: 20 20 20 7d 0a 7d 0a 0a 0a 23 20 2d 2d 2d 2d 2d     }.}...# -----
23c0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
23d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
23e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
23f0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2400: 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 23 20 20 43 6f 6d  ---------.#  Com
2410: 6d 61 6e 64 20 53 63 72 6f 6c 6c 56 69 65 77 3a  mand ScrollView:
2420: 3a 5f 72 65 73 69 7a 65 0a 23 20 2d 2d 2d 2d 2d  :_resize.# -----
2430: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2440: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
2450: 2d 2d 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 0a 70 72 6f 63 20 53  ---------.proc S
2480: 63 72 6f 6c 6c 56 69 65 77 3a 3a 5f 72 65 73 69  crollView::_resi
2490: 7a 65 20 7b 20 70 61 74 68 20 7d 20 7b 0a 20 20  ze { path } {.  
24a0: 20 20 76 61 72 69 61 62 6c 65 20 5f 77 69 64 67    variable _widg
24b0: 65 74 0a 0a 20 20 20 20 73 65 74 20 5f 77 69 64  et..    set _wid
24c0: 67 65 74 28 24 70 61 74 68 2c 62 64 29 20 20 20  get($path,bd)   
24d0: 20 20 5b 57 69 64 67 65 74 3a 3a 67 65 74 6f 70    [Widget::getop
24e0: 74 69 6f 6e 20 24 70 61 74 68 20 2d 62 6f 72 64  tion $path -bord
24f0: 65 72 77 69 64 74 68 5d 0a 20 20 20 20 73 65 74  erwidth].    set
2500: 20 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c 77   _widget($path,w
2510: 69 64 74 68 29 20 20 5b 65 78 70 72 20 7b 5b 77  idth)  [expr {[w
2520: 69 6e 66 6f 20 77 69 64 74 68 20 20 24 70 61 74  info width  $pat
2530: 68 5d 2d 32 2a 24 5f 77 69 64 67 65 74 28 24 70  h]-2*$_widget($p
2540: 61 74 68 2c 62 64 29 7d 5d 0a 20 20 20 20 73 65  ath,bd)}].    se
2550: 74 20 5f 77 69 64 67 65 74 28 24 70 61 74 68 2c  t _widget($path,
2560: 68 65 69 67 68 74 29 20 5b 65 78 70 72 20 7b 5b  height) [expr {[
2570: 77 69 6e 66 6f 20 68 65 69 67 68 74 20 24 70 61  winfo height $pa
2580: 74 68 5d 2d 32 2a 24 5f 77 69 64 67 65 74 28 24  th]-2*$_widget($
2590: 70 61 74 68 2c 62 64 29 7d 5d 0a 20 20 20 20 73  path,bd)}].    s
25a0: 65 74 20 77 20 5b 57 69 64 67 65 74 3a 3a 67 65  et w [Widget::ge
25b0: 74 6f 70 74 69 6f 6e 20 24 70 61 74 68 20 2d 77  toption $path -w
25c0: 69 6e 64 6f 77 5d 0a 20 20 20 20 69 66 20 7b 20  indow].    if { 
25d0: 5b 77 69 6e 66 6f 20 65 78 69 73 74 73 20 24 77  [winfo exists $w
25e0: 5d 20 7d 20 7b 0a 20 20 20 20 20 20 20 20 5f 75  ] } {.        _u
25f0: 70 64 61 74 65 5f 73 63 72 6f 6c 6c 20 24 70 61  pdate_scroll $pa
2600: 74 68 20 30 20 5b 24 77 20 78 76 69 65 77 5d 20  th 0 [$w xview] 
2610: 5b 24 77 20 79 76 69 65 77 5d 0a 20 20 20 20 7d  [$w yview].    }
2620: 0a 7d 0a                                         .}.