diff options
author | jenglish <jenglish@flightlab.com> | 2007-10-25 22:52:41 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2007-10-25 22:52:41 (GMT) |
commit | 2cd3d962db7f314e1251de41c7b4c100e64768d5 (patch) | |
tree | 0259777da74c40461c81c39da638bcf127999148 /tests/ttk | |
parent | 74c0382ad182c608bc1418a8da6bbc6a368cf801 (diff) | |
download | tk-2cd3d962db7f314e1251de41c7b4c100e64768d5.zip tk-2cd3d962db7f314e1251de41c7b4c100e64768d5.tar.gz tk-2cd3d962db7f314e1251de41c7b4c100e64768d5.tar.bz2 |
ttk::notebook: reworked [$nb insert] logic (fixes multiple bugs; see #1817596)
Diffstat (limited to 'tests/ttk')
-rw-r--r-- | tests/ttk/notebook.test | 31 |
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 |