summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/treectrl.tcl30
1 files changed, 28 insertions, 2 deletions
diff --git a/library/treectrl.tcl b/library/treectrl.tcl
index 9b8864e..e1fd3d2 100644
--- a/library/treectrl.tcl
+++ b/library/treectrl.tcl
@@ -435,8 +435,9 @@ proc ::TreeCtrl::Release1 {w x y} {
$w column configure $Priv(column) -sunken no
# Don't generate the event if it wasn't installed
if {[lsearch -exact [$w notify eventnames] Header] != -1} {
- $w notify generate <Header-invoke> [list T $w \
- C $Priv(column)]
+ $w notify generate <Header-invoke> \
+ [list C $Priv(column)] \
+ "::TreeCtrl::PercentsCmd $w"
}
}
}
@@ -921,3 +922,28 @@ proc ::TreeCtrl::ScanDrag {w x y} {
}
return
}
+
+proc ::TreeCtrl::PercentsCmd {T char object event detail charMap} {
+ if {$detail ne ""} {
+ set pattern <$event-$detail>
+ } else {
+ set pattern <$event>
+ }
+ switch -- $char {
+ d { return $detail }
+ e { return $event }
+ P { return $pattern }
+ W { return $object }
+ T { return $T }
+ ? {
+ array set map $charMap
+ array set map [list T $T W $object P $pattern e $event d $detail]
+ return [array get map]
+ }
+ default {
+ array set map [list $char $char]
+ array set map $charMap
+ return $map($char)
+ }
+ }
+}