summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-05-07 18:32:29 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-05-07 18:32:29 (GMT)
commit0115b442d416799d1774ca0b8487f5d66f85d067 (patch)
tree50ebab128ec74c038268431117fb02f5b6aa0cfc /library
parentc00403e250ff3f9d217f19bbc0198f6800102970 (diff)
downloadtk-0115b442d416799d1774ca0b8487f5d66f85d067.zip
tk-0115b442d416799d1774ca0b8487f5d66f85d067.tar.gz
tk-0115b442d416799d1774ca0b8487f5d66f85d067.tar.bz2
Fix [3414695fff]: tk_getOpenFile, tk_getSaveFile, tk_chooseDir: error when parent destroyed first.
Diffstat (limited to 'library')
-rw-r--r--library/choosedir.tcl4
-rw-r--r--library/tk.tcl10
-rw-r--r--library/tkfbox.tcl4
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)
}