summaryrefslogtreecommitdiffstats
path: root/library/ttk/treeview.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/ttk/treeview.tcl')
-rw-r--r--library/ttk/treeview.tcl15
1 files changed, 12 insertions, 3 deletions
diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl
index 4158739..df188b7 100644
--- a/library/ttk/treeview.tcl
+++ b/library/ttk/treeview.tcl
@@ -120,9 +120,18 @@ proc ttk::treeview::ActivateHeading {w heading} {
variable State
if {$w != $State(activeWidget) || $heading != $State(activeHeading)} {
- if {[winfo exists $State(activeWidget)] && $State(activeHeading) != {}
- && $State(activeHeading) in [$State(activeWidget) cget -displaycolumns]} {
- $State(activeWidget) heading $State(activeHeading) state !active
+ if {[winfo exists $State(activeWidget)] && $State(activeHeading) != {}} {
+ # It may happen that $State(activeHeading) no longer corresponds
+ # to an existing display column. This happens for instance when
+ # changing -displaycolumns in a bound script when this change
+ # triggers a <Leave> event. A proc checking if the display column
+ # $State(activeHeading) is really still present or not could be
+ # written but it would need to check several special cases:
+ # a. -displaycolumns "#all" or being an explicit columns list
+ # b. column #0 display is not governed by the -displaycolumn
+ # list but by the value of the -show option
+ # --> Let's rather catch the following line.
+ catch {$State(activeWidget) heading $State(activeHeading) state !active}
}
if {$heading != {}} {
$w heading $heading state active