summaryrefslogtreecommitdiffstats
path: root/tests/ttk
diff options
context:
space:
mode:
authorjenglish <jenglish@noemail.net>2007-10-25 22:52:40 (GMT)
committerjenglish <jenglish@noemail.net>2007-10-25 22:52:40 (GMT)
commitfe9b67bc96c450522f1642ccae35c0fcfa800bd7 (patch)
tree0259777da74c40461c81c39da638bcf127999148 /tests/ttk
parente6d6a5dc52bd09b2573f83f91ef145202ad1065d (diff)
downloadtk-fe9b67bc96c450522f1642ccae35c0fcfa800bd7.zip
tk-fe9b67bc96c450522f1642ccae35c0fcfa800bd7.tar.gz
tk-fe9b67bc96c450522f1642ccae35c0fcfa800bd7.tar.bz2
ttk::notebook: reworked [$nb insert] logic (fixes multiple bugs; see #1817596)
FossilOrigin-Name: 12a800daa1ab921297f0bcceb293bbc9313ff3d5
Diffstat (limited to 'tests/ttk')
-rw-r--r--tests/ttk/notebook.test31
1 files changed, 29 insertions, 2 deletions
diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test
index d4c5e4c..b07ed30 100644
--- a/tests/ttk/notebook.test
+++ b/tests/ttk/notebook.test
@@ -1,5 +1,5 @@
#
-# $Id: notebook.test,v 1.2 2007/06/09 21:45:45 jenglish Exp $
+# $Id: notebook.test,v 1.3 2007/10/25 22:52:42 jenglish Exp $
#
package require Tk 8.5
@@ -312,7 +312,6 @@ test notebook-6.11 "Hide a non-current tab > current" -setup {
lappend result [$nb index current] [winfo ismapped $nb.f2]
} -result [list 1 1 1 1]
-
#
# Insert:
#
@@ -427,4 +426,32 @@ test notebook-7.end "insert - cleanup" -body {
destroy .nb
}
+test notebook-1817596-1 "insert should autoselect first tab" -body {
+ pack [ttk::notebook .nb]
+ list \
+ [.nb insert end [ttk::label .nb.l1 -text One] -text One] \
+ [.nb select] \
+ ;
+} -result [list "" .nb.l1] -cleanup { destroy .nb }
+
+test notebook-1817596-2 "error in insert should have no effect" -body {
+ pack [ttk::notebook .nb]
+ .nb insert end [ttk::label .nb.l1]
+ .nb insert end [ttk::label .nb.l2]
+ list \
+ [catch { .nb insert .l2 0 -badoption badvalue } err] \
+ [.nb tabs] \
+} -result [list 1 [list .nb.l1 .nb.l2]] -cleanup { destroy .nb }
+
+test notebook-1817596-3 "insert/configure" -body {
+ pack [ttk::notebook .nb]
+ .nb insert end [ttk::label .nb.l0] -text "L0"
+ .nb insert end [ttk::label .nb.l1] -text "L1"
+ .nb insert end [ttk::label .nb.l2] -text "XX"
+ .nb insert 0 2 -text "L2"
+
+ list [.nb tabs] [.nb tab 0 -text] [.nb tab 1 -text] [.nb tab 2 -text]
+
+} -result [list [list .nb.l2 .nb.l0 .nb.l1] L2 L0 L1] -cleanup { destroy .nb }
+
tcltest::cleanupTests