diff options
author | fvogel <fvogelnew1@free.fr> | 2023-05-13 08:19:42 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-05-13 08:19:42 (GMT) |
commit | dee111f9330ed5ad6229e8a95ca03f25239b6c9a (patch) | |
tree | 50ebab128ec74c038268431117fb02f5b6aa0cfc /library | |
parent | c00403e250ff3f9d217f19bbc0198f6800102970 (diff) | |
parent | 0115b442d416799d1774ca0b8487f5d66f85d067 (diff) | |
download | tk-dee111f9330ed5ad6229e8a95ca03f25239b6c9a.zip tk-dee111f9330ed5ad6229e8a95ca03f25239b6c9a.tar.gz tk-dee111f9330ed5ad6229e8a95ca03f25239b6c9a.tar.bz2 |
Fix [3414695fff]: tk_getOpenFile, tk_getSaveFile, tk_chooseDir: error when parent destroyed first.
Diffstat (limited to 'library')
-rw-r--r-- | library/choosedir.tcl | 4 | ||||
-rw-r--r-- | library/tk.tcl | 10 | ||||
-rw-r--r-- | library/tkfbox.tcl | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/library/choosedir.tcl b/library/choosedir.tcl index 68dd9b0..33a66b1 100644 --- a/library/choosedir.tcl +++ b/library/choosedir.tcl @@ -118,7 +118,9 @@ proc ::tk::dialog::file::chooseDir:: {args} { foreach trace [trace info variable data(selectPath)] { trace remove variable data(selectPath) [lindex $trace 0] [lindex $trace 1] } - $data(dirMenuBtn) configure -textvariable {} + if {[winfo exists $data(dirMenuBtn)]} { + $data(dirMenuBtn) configure -textvariable {} + } # Return value to user # diff --git a/library/tk.tcl b/library/tk.tcl index 89267d6..e00f073 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -178,10 +178,12 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} { catch {focus $oldFocus} grab release $grab - if {$destroy eq "withdraw"} { - wm withdraw $grab - } else { - destroy $grab + if {[winfo exists $grab]} { + if {$destroy eq "withdraw"} { + wm withdraw $grab + } else { + destroy $grab + } } if {[winfo exists $oldGrab] && [winfo ismapped $oldGrab]} { if {$oldStatus eq "global"} { diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 0c3cc0c..f034778 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -226,7 +226,9 @@ proc ::tk::dialog::file:: {type args} { foreach trace [trace info variable data(selectPath)] { trace remove variable data(selectPath) {*}$trace } - $data(dirMenuBtn) configure -textvariable {} + if {[winfo exists $data(dirMenuBtn)]} { + $data(dirMenuBtn) configure -textvariable {} + } return $Priv(selectFilePath) } |