summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/msgbox.tcl3
-rw-r--r--tests/msgbox.test23
2 files changed, 9 insertions, 17 deletions
diff --git a/library/msgbox.tcl b/library/msgbox.tcl
index 6d329c2..98603af 100644
--- a/library/msgbox.tcl
+++ b/library/msgbox.tcl
@@ -234,7 +234,8 @@ proc ::tk::MessageBox {args} {
}
if {!$valid} {
return -code error -errorcode {TK MSGBOX DEFAULT} \
- "invalid default button \"$data(-default)\""
+ "bad -default value \"$data(-default)\": must be\
+ abort, retry, ignore, ok, cancel, no, or yes"
}
# 2. Set the dialog to be a child window of $parent
diff --git a/tests/msgbox.test b/tests/msgbox.test
index 38004f5..023b1ef 100644
--- a/tests/msgbox.test
+++ b/tests/msgbox.test
@@ -57,35 +57,26 @@ test msgbox-1.11.2 {tk_messageBox command} -constraints aqua -body {
tk_messageBox -type foo
} -returnCodes error -result {bad value "foo": must be abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel}
-test msgbox-1.12 {tk_messageBox command} -constraints x11 -body {
+test msgbox-1.13 {tk_messageBox command} -constraints nonAqua -body {
tk_messageBox -default 1.1
-} -returnCodes error -result {invalid default button "1.1"}
-test msgbox-1.13 {tk_messageBox command} -constraints aqua -body {
+} -returnCodes error -result {bad -default value "1.1": must be abort, retry, ignore, ok, cancel, no, or yes}
+test msgbox-1.13a {tk_messageBox command} -constraints aqua -body {
tk_messageBox -default 1.1
} -returnCodes error -result {bad value "1.1": must be abort, retry, ignore, ok, cancel, yes, or no}
-test msgbox-1.13a {tk_messageBox command} -constraints win -body {
- tk_messageBox -default 1.1
-} -returnCodes error -result {bad -default value "1.1": must be abort, retry, ignore, ok, cancel, no, or yes}
-test msgbox-1.14 {tk_messageBox command} -constraints x11 -body {
+test msgbox-1.14 {tk_messageBox command} -constraints notAqua -body {
tk_messageBox -default foo
-} -returnCodes error -result {invalid default button "foo"}
+} -returnCodes error -result {bad -default value "foo": must be abort, retry, ignore, ok, cancel, no, or yes}
test msgbox-1.15 {tk_messageBox command} -constraints aqua -body {
tk_messageBox -default foo
} -returnCodes error -result {bad value "foo": must be abort, retry, ignore, ok, cancel, yes, or no}
-test msgbox-1.15a {tk_messageBox command} -constraints win -body {
- tk_messageBox -default foo
-} -returnCodes error -result {bad -default value "foo": must be abort, retry, ignore, ok, cancel, no, or yes}
-test msgbox-1.16 {tk_messageBox command} -constraints x11 -body {
+test msgbox-1.16 {tk_messageBox command} -constraints notAqua -body {
tk_messageBox -type yesno -default 3
-} -returnCodes error -result {invalid default button "3"}
+} -returnCodes error -result {bad -default value "3": must be abort, retry, ignore, ok, cancel, no, or yes}
test msgbox-1.17 {tk_messageBox command} -constraints aqua -body {
tk_messageBox -type yesno -default 3
} -returnCodes error -result {bad value "3": must be abort, retry, ignore, ok, cancel, yes, or no}
-test msgbox-1.17a {tk_messageBox command} -constraints win -body {
- tk_messageBox -type yesno -default 3
-} -returnCodes error -result {bad -default value "3": must be abort, retry, ignore, ok, cancel, no, or yes}
test msgbox-1.18 {tk_messageBox command} -constraints notAqua -body {
tk_messageBox -icon foo