diff options
author | hobbs <hobbs@noemail.net> | 2007-10-25 21:44:21 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2007-10-25 21:44:21 (GMT) |
commit | e6d6a5dc52bd09b2573f83f91ef145202ad1065d (patch) | |
tree | 0e316eba5bf980a1124288597f60247798da5ef9 /tests/filebox.test | |
parent | 1d1b80bfef2bae81e160aabb11c5ed18705d454a (diff) | |
download | tk-e6d6a5dc52bd09b2573f83f91ef145202ad1065d.zip tk-e6d6a5dc52bd09b2573f83f91ef145202ad1065d.tar.gz tk-e6d6a5dc52bd09b2573f83f91ef145202ad1065d.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:
FossilOrigin-Name: 32679bf38647e40e47ad512d393e4e2004cacfb9
Diffstat (limited to 'tests/filebox.test')
-rw-r--r-- | tests/filebox.test | 27 |
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 |