diff options
author | fvogel <fvogelnew1@free.fr> | 2023-05-13 08:19:53 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-05-13 08:19:53 (GMT) |
commit | 4f73e52f91e885e7b4d5b38c4130b96965531cc0 (patch) | |
tree | a87842ba0ac96c424c14e0ff195286e05537d2ae /library | |
parent | 9fd59f36dfce24d68e74ac61ac314929bd95de96 (diff) | |
parent | dee111f9330ed5ad6229e8a95ca03f25239b6c9a (diff) | |
download | tk-4f73e52f91e885e7b4d5b38c4130b96965531cc0.zip tk-4f73e52f91e885e7b4d5b38c4130b96965531cc0.tar.gz tk-4f73e52f91e885e7b4d5b38c4130b96965531cc0.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 6b4f15e..c583215 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 d4656a1..7f3ede3 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 4549fa5..9c43cf6 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -201,7 +201,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) } |