diff options
author | treectrl <treectrl> | 2006-12-07 03:47:42 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2006-12-07 03:47:42 (GMT) |
commit | 9eab9c67a66a02022ba2d4a4a36f1cfb53902b7b (patch) | |
tree | 91581dfa9253187b726bcf785db7ed70efbc9430 /demos | |
parent | 68604c0aecb5a887195029f64f4b919374c25af6 (diff) | |
download | tktreectrl-9eab9c67a66a02022ba2d4a4a36f1cfb53902b7b.zip tktreectrl-9eab9c67a66a02022ba2d4a4a36f1cfb53902b7b.tar.gz tktreectrl-9eab9c67a66a02022ba2d4a4a36f1cfb53902b7b.tar.bz2 |
Use the new style layout option -draw instead of the deprecated element option of the same name.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/biglist.tcl | 14 | ||||
-rw-r--r-- | demos/explorer.tcl | 20 | ||||
-rw-r--r-- | demos/firefox.tcl | 6 |
3 files changed, 23 insertions, 17 deletions
diff --git a/demos/biglist.tcl b/demos/biglist.tcl index 8bc5a37..0487f99 100644 --- a/demos/biglist.tcl +++ b/demos/biglist.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: biglist.tcl,v 1.13 2006/12/04 00:16:02 treectrl Exp $ +# RCS: @(#) $Id: biglist.tcl,v 1.14 2006/12/07 03:47:42 treectrl Exp $ set ::clip 1 proc DemoBigList {} { @@ -40,11 +40,11 @@ if {$::clip} { set outline gray70 $T element create eRectTop.e rect -outline $outline -fill $BigList(bg) \ - -draw {yes open no {}} -outlinewidth 1 -open es + -outlinewidth 1 -open es $T element create eRectTop.we rect -outline $outline -fill $BigList(bg) \ - -draw {yes open no {}} -outlinewidth 1 -open wes + -outlinewidth 1 -open wes $T element create eRectTop.w rect -outline $outline -fill $BigList(bg) \ - -draw {yes open no {}} -outlinewidth 1 -open ws + -outlinewidth 1 -open ws $T element create eRectBottom rect -outline $outline -fill $BigList(bg) \ -outlinewidth 1 -open n @@ -78,20 +78,20 @@ if {$::clip} { set S [$T style create styItem] $T style elements $S {eRectTop.e elemRectSel elemTxtItem elemTxtName} - $T style layout $S eRectTop.e -detach yes -indent no -iexpand xy + $T style layout $S eRectTop.e -detach yes -indent no -iexpand xy -draw {yes open no {}} $T style layout $S elemTxtItem -expand ns $T style layout $S elemTxtName -expand ns -padx {20} $T style layout $S elemRectSel -detach yes -indent no -iexpand xy set S [$T style create styID] $T style elements $S {eRectTop.we elemRectSel elemTxtItem} - $T style layout $S eRectTop.we -detach yes -indent yes -iexpand xy + $T style layout $S eRectTop.we -detach yes -indent yes -iexpand xy -draw {yes open no {}} $T style layout $S elemTxtItem -padx 6 -expand ns $T style layout $S elemRectSel -detach yes -indent no -iexpand xy set S [$T style create styParent] $T style elements $S {eRectTop.w elemRectSel elemTxtItem} - $T style layout $S eRectTop.w -detach yes -indent yes -iexpand xy + $T style layout $S eRectTop.w -detach yes -indent yes -iexpand xy -draw {yes open no {}} $T style layout $S elemTxtItem -padx 6 -expand ns $T style layout $S elemRectSel -detach yes -indent no -iexpand xy diff --git a/demos/explorer.tcl b/demos/explorer.tcl index 45de1c8..6f1d166 100644 --- a/demos/explorer.tcl +++ b/demos/explorer.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: explorer.tcl,v 1.24 2006/11/30 02:41:38 treectrl Exp $ +# RCS: @(#) $Id: explorer.tcl,v 1.25 2006/12/07 03:52:40 treectrl Exp $ set Dir [file dirname [file dirname [info script]]] @@ -166,14 +166,17 @@ proc DemoExplorerDetails {} { } # During editing, hide the text and selection-rectangle elements. + $T state define edit + $T style layout styName txtName -draw {no edit} + $T style layout styName elemRectSel -draw {no edit} $T notify bind $T <Edit-begin> { - %T item element configure %I %C txtName -draw no + elemRectSel -draw no + %T item state set %I ~edit } $T notify bind $T <Edit-accept> { %T item element configure %I %C %E -text %t } $T notify bind $T <Edit-end> { - %T item element configure %I %C txtName -draw yes + elemRectSel -draw yes + %T item state set %I ~edit } # @@ -362,8 +365,8 @@ proc DemoExplorerLargeIcons {} { # During editing, hide the text and selection-rectangle elements. $T state define edit - $T element configure elemTxt -draw {no edit} - $T element configure elemSel -draw {no edit} + $T style layout STYLE elemTxt -draw {no edit} + $T style layout STYLE elemSel -draw {no edit} $T notify bind $T <Edit-begin> { %T item state set %I ~edit } @@ -519,14 +522,17 @@ proc DemoExplorerList {} { } # During editing, hide the text and selection-rectangle elements. + $T state define edit + $T style layout STYLE elemTxt -draw {no edit} + $T style layout STYLE elemSel -draw {no edit} $T notify bind $T <Edit-begin> { - %T item element configure %I %C elemSel -draw no + elemTxt -draw no + %T item state set %I ~edit } $T notify bind $T <Edit-accept> { %T item element configure %I %C %E -text %t } $T notify bind $T <Edit-end> { - %T item element configure %I %C elemSel -draw yes + elemTxt -draw yes + %T item state set %I ~edit } # diff --git a/demos/firefox.tcl b/demos/firefox.tcl index e23783d..0b98125 100644 --- a/demos/firefox.tcl +++ b/demos/firefox.tcl @@ -1,4 +1,4 @@ -# RCS: @(#) $Id: firefox.tcl,v 1.19 2006/12/04 00:16:02 treectrl Exp $ +# RCS: @(#) $Id: firefox.tcl,v 1.20 2006/12/07 03:53:05 treectrl Exp $ proc DemoFirefoxPrivacy {} { @@ -67,7 +67,7 @@ if {$::clip} { if {$::clip} { $T element configure eWindow -clip yes } $T element create eText1 text -font [list DemoFontBold] $T element create eRectTop rect -outline black -fill #FFFFCC \ - -draw {yes open no {}} -outlinewidth 1 -open s + -outlinewidth 1 -open s $T element create eRectBottom rect -outline black -fill #FFFFCC \ -outlinewidth 1 -open n @@ -81,7 +81,7 @@ if {$::clip} { $T element configure eWindow -clip yes } set S [$T style create styCategory -orient horizontal] $T style elements $S {eRectTop eText1 eWindow} - $T style layout $S eRectTop -detach yes -indent no -iexpand xy + $T style layout $S eRectTop -detach yes -indent no -iexpand xy -draw {yes open no {}} # note: using -iexpand x so clicking in the text works better $T style layout $S eText1 -expand ns -iexpand x -sticky w $T style layout $S eWindow -expand ns -padx 10 -pady 6 |