summaryrefslogtreecommitdiffstats
path: root/tests/filebox.test
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-10-25 21:44:21 (GMT)
committerhobbs <hobbs>2007-10-25 21:44:21 (GMT)
commit74c0382ad182c608bc1418a8da6bbc6a368cf801 (patch)
tree0e316eba5bf980a1124288597f60247798da5ef9 /tests/filebox.test
parent4ce5204218fe597d1a9e90e874f1c716b2dcf411 (diff)
downloadtk-74c0382ad182c608bc1418a8da6bbc6a368cf801.zip
tk-74c0382ad182c608bc1418a8da6bbc6a368cf801.tar.gz
tk-74c0382ad182c608bc1418a8da6bbc6a368cf801.tar.bz2
* doc/getOpenFile.n: TIP#242 implementation of -typevariable to
* library/tkfbox.tcl: return type of selected file in file dialogs. * library/xmfbox.tcl: [Bug #1156388] * macosx/tkMacOSXDialog.c: * tests/filebox.test: * tests/winDialog.test: * win/tkWinDialog.c:
Diffstat (limited to 'tests/filebox.test')
-rw-r--r--tests/filebox.test27
1 files changed, 24 insertions, 3 deletions
diff --git a/tests/filebox.test b/tests/filebox.test
index 432323d..9e9fe11 100644
--- a/tests/filebox.test
+++ b/tests/filebox.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: filebox.test,v 1.18 2004/12/20 10:34:20 vincentdarley Exp $
+# RCS: @(#) $Id: filebox.test,v 1.19 2007/10/25 21:44:23 hobbs Exp $
#
package require tcltest 2.1
@@ -113,8 +113,8 @@ if {$tcl_platform(platform) == "unix"} {
set modes 1
}
-set unknownOptionsMsg(tk_getOpenFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, or -title}
-set unknownOptionsMsg(tk_getSaveFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, or -title}
+set unknownOptionsMsg(tk_getOpenFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, -title, or -typevariable}
+set unknownOptionsMsg(tk_getSaveFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, -title, or -typevariable}
set tmpFile "filebox.tmp"
makeFile {
@@ -269,6 +269,27 @@ foreach mode $modes {
-initialfile $fileName -initialdir $fileDir]
} $pathName
}
+ foreach {x res} [list 1 "-unset-" 2 "Text files"] {
+ set t [expr {$x + [llength [array names filters]]}]
+ test filebox-3.$t-$mode "tk_getOpenFile command" nonUnixUserInteraction {
+ catch {unset tv}
+ catch {unset typeName}
+ ToPressButton $parent ok
+ if {[info exists tv]} {
+ } else {
+ }
+ set choice [tk_getOpenFile -title "Press Ok" \
+ -filetypes $filters($x) -parent $parent \
+ -initialfile $fileName -initialdir $fileDir \
+ -typevariable tv]
+ if {[info exists tv]} {
+ regexp {^(.*) \(.*\)$} $tv dummy typeName
+ } else {
+ set typeName "-unset-"
+ }
+ set typeName
+ } $res
+ }
test filebox-4.1-$mode "tk_getSaveFile command" -body {
tk_getSaveFile -foo