(get_class): check to make sure window still exists.
authorsls <sls>
Wed, 21 Jun 1995 21:54:31 +0000 (21:54 +0000)
committersls <sls>
Wed, 21 Jun 1995 21:54:31 +0000 (21:54 +0000)
windows_info.tcl

index f005d774fd09d76c93d9999b82feca1ffea700f4..64b02aec859dc00ff1fa54d3384f315afa69cb3b 100644 (file)
@@ -38,6 +38,14 @@ object_class windows_info {
     }
     method get_class {target w} {
        if ![info exists slot($w.class)] {
+           if ![send $target winfo exists $w] {
+               # the window no longer exists, so delete it from our list
+               set ndx [lsearch -exact $slot(windows) $w]
+               if {$ndx >= 0} {
+                   set slot(windows) [lreplace $slot(windows) $ndx $ndx]
+               }
+               return ""
+           }
            set slot($w.class) [send $target [list winfo class $w]]
        }
        return $slot($w.class)