summaryrefslogtreecommitdiffstats
path: root/demos/demo.tcl
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-11-25 20:21:26 (GMT)
committertreectrl <treectrl>2006-11-25 20:21:26 (GMT)
commitc3fd862049c9b80c748fad26496bf78c28e8007b (patch)
tree56c901636e1c8c79c996fa729eed99fb7d99ca1c /demos/demo.tcl
parentba58be95010e7a8fef177ea8f96c408371f7d82d (diff)
downloadtktreectrl-c3fd862049c9b80c748fad26496bf78c28e8007b.zip
tktreectrl-c3fd862049c9b80c748fad26496bf78c28e8007b.tar.gz
tktreectrl-c3fd862049c9b80c748fad26496bf78c28e8007b.tar.bz2
Don't update the styles-in-item list until the mouse is released over an item. It can give a false impression that a main list update is slower than it really is.
Diffstat (limited to 'demos/demo.tcl')
-rw-r--r--demos/demo.tcl13
1 files changed, 10 insertions, 3 deletions
diff --git a/demos/demo.tcl b/demos/demo.tcl
index 01503df..8a4af86 100644
--- a/demos/demo.tcl
+++ b/demos/demo.tcl
@@ -1,6 +1,6 @@
#!/bin/wish84.exe
-# RCS: @(#) $Id: demo.tcl,v 1.56 2006/11/23 22:24:56 treectrl Exp $
+# RCS: @(#) $Id: demo.tcl,v 1.57 2006/11/25 20:21:26 treectrl Exp $
set VERSION 2.2
@@ -1372,9 +1372,16 @@ proc DisplayStylesInItem {item} {
# When one item is selected in the demo list, display the styles in that item.
# See DemoClear for why the tag "DontDelete" is used.
+set DisplayStylesInItem(item) ""
+bind [DemoList] <ButtonRelease-1> {
+ if {$DisplayStylesInItem(item) ne ""} {
+ DisplayStylesInItem $DisplayStylesInItem(item)
+ set DisplayStylesInItem(item) ""
+ }
+}
[DemoList] notify bind DontDelete <Selection> {
if {%c == 1} {
- DisplayStylesInItem [%T selection get 0]
+ set DisplayStylesInItem(item) [%T selection get 0]
}
}
@@ -1442,7 +1449,7 @@ proc DemoClear {} {
$T column dragconfigure -enable yes
# Restore default bindings to the demo list
- bindtags $T [list $T TreeCtrl [winfo toplevel $T] all]
+ bindtags $T [list $T TreeCtrl [winfo toplevel $T] all DisplayStylesInItemBindTag]
catch {destroy $T.entry}
catch {destroy $T.text}