diff options
author | treectrl <treectrl> | 2006-11-19 00:53:40 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2006-11-19 00:53:40 (GMT) |
commit | e2e5e9b30df462e14f186b9c1c56882e18dd59a2 (patch) | |
tree | cffc8bd18be8571672910d7d480885f0ee4381da /demos/help.tcl | |
parent | 8131aeeb28373fc0a0686f5affa6b42d7a77bcde (diff) | |
download | tktreectrl-e2e5e9b30df462e14f186b9c1c56882e18dd59a2.zip tktreectrl-e2e5e9b30df462e14f186b9c1c56882e18dd59a2.tar.gz tktreectrl-e2e5e9b30df462e14f186b9c1c56882e18dd59a2.tar.bz2 |
Use updated [selection get] syntax.
Replaced a foreach loop with a multi-item description.
Diffstat (limited to 'demos/help.tcl')
-rw-r--r-- | demos/help.tcl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/demos/help.tcl b/demos/help.tcl index f23f06c..7701e62 100644 --- a/demos/help.tcl +++ b/demos/help.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: help.tcl,v 1.18 2006/11/18 04:38:27 treectrl Exp $ +# RCS: @(#) $Id: help.tcl,v 1.19 2006/11/19 00:53:40 treectrl Exp $ # # Demo: Help contents @@ -120,7 +120,7 @@ proc DemoHelpContents {} { } bind DemoHelpContents <KeyPress-Return> { if {[%W selection count] == 1} { - %W item toggle [lindex [%W selection get] 0] + %W item toggle [%W selection get 0] } break } @@ -260,7 +260,7 @@ proc DemoHelpContents_2 {} { } bind DemoHelpContents <KeyPress-Return> { if {[%W selection count] == 1} { - %W item toggle [lindex [%W selection get] 0] + %W item toggle [%W selection get 0] } break } @@ -287,7 +287,7 @@ proc HelpButton1 {w x y} { return } if {[$w selection count]} { - set item2 [lindex [$w selection get] 0] + set item2 [$w selection get 0] $w item collapse $item2 foreach item2 [$w item ancestors $item2] { if {[$w item compare $item != $item2]} { @@ -296,9 +296,7 @@ proc HelpButton1 {w x y} { } } $w activate $item - foreach item2 [$w item ancestors $item] { - $w item expand $item2 - } + $w item expand [list $item ancestors] $w item toggle $item $w selection modify $item all } |