From cf0ab9321dd689a22c6d59f52b14d479605553e9 Mon Sep 17 00:00:00 2001
From: fvogel <fvogelnew1@free.fr>
Date: Thu, 1 Nov 2018 21:29:32 +0000
Subject: [PATCH 436/693] Fix [6b22d436aa]: Treeview ActivateHeading Binding
 Fails After Widget Deletion. Thanks to Brian O'Hagan for the report and the
 patch.

---
 library/ttk/treeview.tcl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl
index 87725875e..1ed87dbcd 100644
--- a/library/ttk/treeview.tcl
+++ b/library/ttk/treeview.tcl
@@ -120,7 +120,7 @@ proc ttk::treeview::ActivateHeading {w heading} {
     variable State
 
     if {$w != $State(activeWidget) || $heading != $State(activeHeading)} {
-	if {$State(activeHeading) != {}} {
+	if {[winfo exists $State(activeWidget)] && $State(activeHeading) != {}} {
 	    $State(activeWidget) heading $State(activeHeading) state !active
 	}
 	if {$heading != {}} {
-- 
2.19.1

