summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2019-05-08 08:40:09 (GMT)
committerfvogel <fvogelnew1@free.fr>2019-05-08 08:40:09 (GMT)
commitd843a7eadb157bca482e150f7298e9cf3007c85c (patch)
tree0f217148397549251bffbcb4b01cb93397fcc107 /tests
parent01461b552198a9b080cf21446514ed0bc061419f (diff)
parent2fa09ced062e7964597b77f6ec9c04fd00001ee4 (diff)
downloadtk-d843a7eadb157bca482e150f7298e9cf3007c85c.zip
tk-d843a7eadb157bca482e150f7298e9cf3007c85c.tar.gz
tk-d843a7eadb157bca482e150f7298e9cf3007c85c.tar.bz2
Fix [2513186fff], [f9343d8f72] and [8261c517af]: ttk scrolling (xview/yview commands) is incorrect until idle tasks are run
Diffstat (limited to 'tests')
-rw-r--r--tests/ttk/entry.test29
-rw-r--r--tests/ttk/treeview.test12
2 files changed, 40 insertions, 1 deletions
diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test
index d95ef31..a920042 100644
--- a/tests/ttk/entry.test
+++ b/tests/ttk/entry.test
@@ -103,10 +103,37 @@ test entry-3.1 "bbox widget command" -body {
test entry-3.2 "xview" -body {
.e delete 0 end;
.e insert end [string repeat "0" 40]
- update idletasks
set result [.e xview]
} -result {0.0 0.5}
+test entry-3.3 "xview" -body {
+ .e delete 0 end;
+ .e insert end abcdefghijklmnopqrstuvwxyz
+ .e xview end
+ set result [.e index @0]
+} -result {7}
+
+test entry-3.4 "xview" -body {
+ .e delete 0 end;
+ .e insert end abcdefghijklmnopqrstuvwxyz
+ .e xview moveto 1.0
+ set result [.e index @0]
+} -result {7}
+
+test entry-3.5 "xview" -body {
+ .e delete 0 end;
+ .e insert end abcdefghijklmnopqrstuvwxyz
+ .e xview scroll 5 units
+ set result [.e index @0]
+} -result {5}
+
+test entry-3.6 "xview" -body {
+ .e delete 0 end;
+ .e insert end [string repeat abcdefghijklmnopqrstuvwxyz 5]
+ .e xview scroll 2 pages
+ set result [.e index @0]
+} -result {40}
+
test entry-3.last "Series 3 cleanup" -body {
destroy .e
}
diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test
index be82f68..a36e3d1 100644
--- a/tests/ttk/treeview.test
+++ b/tests/ttk/treeview.test
@@ -471,6 +471,18 @@ test treeview-9.0 "scroll callback - empty tree" -body {
set ::scrolldata
} -result [list 0.0 1.0]
+test treeview-9.1 "scrolling" -setup {
+ pack [ttk::treeview .tree -show tree] -fill y
+ for {set i 1} {$i < 100} {incr i} {
+ .tree insert {} end -text $i
+ }
+} -body {
+ .tree yview scroll 5 units
+ .tree identify item 2 2
+} -cleanup {
+ destroy .tree
+} -result {I006}
+
### identify tests:
#
proc identify* {tv comps args} {