summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--changes3
-rw-r--r--tests/filebox.test43
2 files changed, 44 insertions, 2 deletions
diff --git a/changes b/changes
index 616210b..f390f00 100644
--- a/changes
+++ b/changes
@@ -4145,3 +4145,6 @@ and tk_getSaveFile to convert the specified directory to an absolute
path and to use the current working directory if the specified
directory does not exist. (SS)
+6/25/98 (bug fix) On Unix, both the Tk and the Motif file dialogs
+would fail if the -parent flag changed between two parent windows that
+had been previously used as file dialog parents. (SS)
diff --git a/tests/filebox.test b/tests/filebox.test
index 83f320c..c687b0b 100644
--- a/tests/filebox.test
+++ b/tests/filebox.test
@@ -40,7 +40,11 @@ proc PressButton {btn} {
proc EnterFileByKey {parent fileName fileDir} {
global tk_strictMotif
- set w .__tk_filedialog
+ if {$parent == "."} {
+ set w .__tk_filedialog
+ } else {
+ set w $parent.__tk_filedialog
+ }
upvar #0 [winfo name $w] data
if {$tk_strictMotif} {
@@ -57,7 +61,11 @@ proc EnterFileByKey {parent fileName fileDir} {
proc SendButtonPress {parent btn type} {
global tk_strictMotif
- set w .__tk_filedialog
+ if {$parent == "."} {
+ set w .__tk_filedialog
+ } else {
+ set w $parent.__tk_filedialog
+ }
upvar #0 [winfo name $w] data
set button $data($btn\Btn)
@@ -205,6 +213,37 @@ foreach mode $modes {
-initialfile $fileName]
} $pathName
+ test filebox-2.5 "$command command" {
+ ToPressButton $parent ok
+ set choice [$command -title "Enter \"$fileName\" and press Ok" \
+ -parent $parent -initialdir /badpath \
+ -initialfile $fileName]
+ } $pathName
+
+ test filebox-2.6 "$command command" {
+ toplevel .t1; toplevel .t2
+ ToPressButton .t1 ok
+ set choice {}
+ lappend choice [$command \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t1 -initialdir $fileDir \
+ -initialfile $fileName]
+ ToPressButton .t2 ok
+ lappend choice [$command \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t2 -initialdir $fileDir \
+ -initialfile $fileName]
+ ToPressButton .t1 ok
+ lappend choice [$command \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t1 -initialdir $fileDir \
+ -initialfile $fileName]
+ destroy .t1
+ destroy .t2
+ set choice
+ } [list $pathName $pathName $pathName]
+
+
set filters(1) {}