From 6d7a6e55df5be4f76280cb800e87257946f7deb7 Mon Sep 17 00:00:00 2001 From: treectrl Date: Wed, 4 Oct 2006 03:57:08 +0000 Subject: Column -tag is now -tags (although -tag is still backwards-compatible). --- demos/biglist.tcl | 34 +++++++++++++++++----------------- demos/bitmaps.tcl | 4 ++-- demos/explorer.tcl | 16 ++++++++-------- demos/help.tcl | 5 ++--- demos/imovie.tcl | 4 ++-- 5 files changed, 31 insertions(+), 32 deletions(-) diff --git a/demos/biglist.tcl b/demos/biglist.tcl index b8dbd90..c1cab8d 100644 --- a/demos/biglist.tcl +++ b/demos/biglist.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: biglist.tcl,v 1.7 2006/09/27 01:58:43 treectrl Exp $ +# RCS: @(#) $Id: biglist.tcl,v 1.8 2006/10/04 03:57:08 treectrl Exp $ set ::clip 1 proc DemoBigList {} { @@ -25,9 +25,9 @@ if {$::clip} { # Create columns # - $T column create -expand yes -text Item -itembackground {#F7F7F7} -tag colItem - $T column create -text "Item ID" -justify center -itembackground {} -tag colID - $T column create -text "Parent ID" -justify center -itembackground {} -tag colParent + $T column create -expand yes -text Item -itembackground {#F7F7F7} -tags colItem + $T column create -text "Item ID" -justify center -itembackground {} -tags colID + $T column create -text "Parent ID" -justify center -itembackground {} -tags colParent # Specify the column that will display the heirarchy buttons and lines $T configure -treecolumn colItem @@ -175,7 +175,7 @@ proc BigListExpandBefore {T I} { if {[$T item numchildren $I]} return # Title - if {[$T tag expr $I title]} { + if {[$T item tag expr $I title]} { set index $BigList(titleIndex,$I) set threats {Severe High Elevated Guarded Low} set names1 {Bill John Jack Bob Tim Sam Mary Susan Lilian Jeff Gary @@ -198,7 +198,7 @@ proc BigListExpandBefore {T I} { } # Citizen - if {[$T tag expr $I citizen]} { + if {[$T item tag expr $I citizen]} { # Add 1 child item to this item. # The styles will be assigned in BigListItemVisibility. @@ -218,7 +218,7 @@ proc BigListItemVisibility {T visible hidden} { set parent [$T item parent $I] # Title - if {[$T tag expr $I title]} { + if {[$T item tag expr $I title]} { set first $BigList(titleIndex,$I) set last [expr {$first + 10 - 1}] set first [format %06d $first] @@ -231,7 +231,7 @@ proc BigListItemVisibility {T visible hidden} { } # Citizen - if {[$T tag expr $I citizen]} { + if {[$T item tag expr $I citizen]} { set index $BigList(itemIndex,$I) $T item style set $I colItem styItem colID styID colParent styParent $T item element configure $I \ @@ -242,7 +242,7 @@ proc BigListItemVisibility {T visible hidden} { } # Citizen info - if {[$T tag expr $I info]} { + if {[$T item tag expr $I info]} { set w [BigListNewWindow $T $parent] $T item style set $I colItem styCitizen $T item span $I colItem 3 @@ -255,7 +255,7 @@ proc BigListItemVisibility {T visible hidden} { foreach I $hidden { # Citizen info - if {[$T tag expr $I info]} { + if {[$T item tag expr $I info]} { # Add this window to the list of unused windows set w [$T item element cget $I colItem elemWindow -window] BigListFreeWindow $T $w @@ -273,8 +273,8 @@ proc BigListNewWindow {T I} { set w [lindex $BigList(freeWindows) 0] set BigList(freeWindows) [lrange $BigList(freeWindows) 1 end] if {$::clip} { - set f $w - set w [lindex [winfo children $f] 0] + set f $w + set w [lindex [winfo children $f] 0] } puts "reuse window $w" @@ -282,14 +282,14 @@ puts "reuse window $w" } else { set id [incr BigList(nextWindowId)] if {$::clip} { - set f [frame $T.clip$id -background blue] - set w [frame $f.frame$id -background $BigList(bg)] + set f [frame $T.clip$id -background blue] + set w [frame $f.frame$id -background $BigList(bg)] } else { set w [frame $T.frame$id -background $BigList(bg)] } # Name: label + entry label $w.label1 -text "Name:" -anchor w -background $BigList(bg) - entry $w.entry1 -width 24 + $::entryCmd $w.entry1 -width 24 # Threat Level: label + menubutton label $w.label2 -text "Threat Level:" -anchor w -background $BigList(bg) @@ -366,7 +366,7 @@ proc BigListButton1 {w x y} { TreeCtrl::ButtonPress1 $w $x $y return } - if {[$w tag expr $item !info]} { + if {[$w item tag expr $item !info]} { $w toggle $item } } @@ -378,7 +378,7 @@ proc BigListMotion {w x y} { set id [$w identify $x $y] if {[lindex $id 0] eq "item"} { set item [lindex $id 1] - if {[$w tag expr $item !info]} { + if {[$w item tag expr $item !info]} { if {$item ne $BigList(prev)} { $w configure -cursor hand2 set BigList(prev) $item diff --git a/demos/bitmaps.tcl b/demos/bitmaps.tcl index a26fc56..8544ee6 100644 --- a/demos/bitmaps.tcl +++ b/demos/bitmaps.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: bitmaps.tcl,v 1.7 2005/07/11 01:59:07 treectrl Exp $ +# RCS: @(#) $Id: bitmaps.tcl,v 1.8 2006/10/04 03:57:31 treectrl Exp $ # # Demo: Bitmaps @@ -19,7 +19,7 @@ proc DemoBitmaps {} { # Create columns # - $T column create -itembackground {gray90 {}} -tag C0 + $T column create -itembackground {gray90 {}} -tags C0 # # Create elements diff --git a/demos/explorer.tcl b/demos/explorer.tcl index 81afaba..0a6dd76 100644 --- a/demos/explorer.tcl +++ b/demos/explorer.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: explorer.tcl,v 1.18 2006/09/27 01:56:59 treectrl Exp $ +# RCS: @(#) $Id: explorer.tcl,v 1.19 2006/10/04 03:57:52 treectrl Exp $ set Dir [file dirname [file dirname [info script]]] @@ -79,12 +79,12 @@ proc DemoExplorerDetails {} { # Create columns # - $T column create -text Name -tag name -width 200 \ + $T column create -text Name -tags name -width 200 \ -arrow up -itembackground #F7F7F7 - $T column create -text Size -tag size -justify right -width 60 \ + $T column create -text Size -tags size -justify right -width 60 \ -arrowside left -arrowgravity right - $T column create -text Type -tag type -width 120 - $T column create -text Modified -tag modified -width 120 + $T column create -text Type -tags type -width 120 + $T column create -text Modified -tags modified -width 120 # Demonstration of per-state column options and configure "all" $T column configure all -background {gray90 active gray70 normal gray50 pressed} @@ -243,7 +243,7 @@ proc ExplorerHeaderInvoke {T C} { set dirCount $::TreeCtrl::Priv(DirCnt,$T) set fileCount [expr {[$T item count] - 1 - $dirCount}] set lastDir [expr {$dirCount - 1}] - switch [$T column cget $C -tag] { + switch [$T column cget $C -tags] { name { if {$dirCount} { $T item sort root $order -last "root child $lastDir" -column $C -dictionary @@ -296,7 +296,7 @@ proc DemoExplorerLargeIcons {} { # Create columns # - $T column create -tag C0 + $T column create -tags C0 # # Create elements @@ -446,7 +446,7 @@ proc DemoExplorerList {} { # Create columns # - $T column create -tag C0 + $T column create -tags C0 # # Create elements diff --git a/demos/help.tcl b/demos/help.tcl index 920c7a6..938a3b8 100644 --- a/demos/help.tcl +++ b/demos/help.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: help.tcl,v 1.16 2005/07/11 01:59:07 treectrl Exp $ +# RCS: @(#) $Id: help.tcl,v 1.17 2006/10/04 03:58:08 treectrl Exp $ # # Demo: Help contents @@ -27,7 +27,7 @@ proc DemoHelpContents {} { # Create columns # - $T column create -text "Help Contents" -tag C0 + $T column create -text "Help Contents" -tags C0 $T configure -treecolumn C0 @@ -306,7 +306,6 @@ proc HelpButton1 {w x y} { } proc HelpMotion {w x y} { - variable TreeCtrl::Priv global HelpContents set id [$w identify $x $y] if {$id eq ""} { diff --git a/demos/imovie.tcl b/demos/imovie.tcl index 06eb2d7..5a847c4 100644 --- a/demos/imovie.tcl +++ b/demos/imovie.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: imovie.tcl,v 1.11 2006/09/24 23:00:13 treectrl Exp $ +# RCS: @(#) $Id: imovie.tcl,v 1.12 2006/10/04 03:58:26 treectrl Exp $ # # Demo: iMovie @@ -19,7 +19,7 @@ proc DemoIMovie {} { # Create columns # - $T column create -tag C0 + $T column create -tags C0 InitPics imovie-* -- cgit v0.12