summaryrefslogtreecommitdiffstats
path: root/tests/textDisp.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/textDisp.test')
-rw-r--r--tests/textDisp.test51
1 files changed, 41 insertions, 10 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 3022a54..5dfed82 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -598,7 +598,7 @@ test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} {textfonts} {
list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout
} [list [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] {} [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] {1.0 2.0 3.0}]
test textDisp-4.5 {UpdateDisplayInfo, tiny window} {textfonts} {
- if {$tcl_platform(platform) == "windows"} {
+ if {[tk windowingsystem] == "win32"} {
wm overrideredirect . 1
}
wm geom . 103x$height
@@ -609,7 +609,7 @@ test textDisp-4.5 {UpdateDisplayInfo, tiny window} {textfonts} {
updateText
list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout
} [list [list 5 [expr {$fixedDiff + 18}] 1 $fixedHeight] {} [list 5 [expr {2*$fixedDiff + 31}] 1 $fixedHeight] {1.0 2.0 3.0}]
-if {$tcl_platform(platform) == "windows"} {
+if {[tk windowingsystem] == "win32"} {
wm overrideredirect . 0
}
test textDisp-4.6 {UpdateDisplayInfo, tiny window} {
@@ -620,7 +620,7 @@ test textDisp-4.6 {UpdateDisplayInfo, tiny window} {
# the overrideredirect on "." confuses the window manager and
# causes subsequent tests to fail.
- if {$tcl_platform(platform) == "windows"} {
+ if {[tk windowingsystem] == "win32"} {
wm overrideredirect . 1
}
frame .f2 -width 20 -height 100
@@ -652,7 +652,7 @@ test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} {
# the overrideredirect on "." confuses the window manager and
# causes subsequent tests to fail.
- if {$tcl_platform(platform) == "windows"} {
+ if {[tk windowingsystem] == "win32"} {
wm overrideredirect . 1
}
.t delete 1.0 end
@@ -1341,11 +1341,11 @@ test textDisp-9.10 {TkTextRedrawTag} {
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4"
.t tag add big 1.0 2.0
updateText
- set tk_textRedraw {none}
+ set tk_textRedraw none
.t tag add big 1.3 1.5
updateText
set tk_textRedraw
-} {none}
+} none
test textDisp-9.11 {TkTextRedrawTag} {
.t configure -wrap char
.t delete 1.0 end
@@ -1660,6 +1660,21 @@ test textDisp-11.21 {TkTextSetYView, window height smaller than the line height}
.top.t see 1.0
.top.t index @0,[expr {$lineheight - 2}]
} {1.0}
+test textDisp-11.22 {TkTextSetYView, peer has -startline} {
+ .top.t delete 1.0 end
+ for {set i 1} {$i <= 50} {incr i} {
+ .top.t insert end "Line $i\n"
+ }
+ pack [.top.t peer create .top.p] -side left
+ pack [scrollbar .top.sb -command {.top.p yview}] -side left -fill y
+ .top.p configure -startline 5 -endline 35 -yscrollcommand {.top.sb set}
+ updateText
+ .top.p yview moveto 0
+ updateText
+ set res [.top.p get @0,0 "@0,0 lineend"]
+ destroy .top.p
+ set res
+} {Line 5}
.t configure -wrap word
.t delete 50.0 51.0
@@ -2352,45 +2367,61 @@ test textDisp-17.5 {TkTextScanCmd procedure} {
test textDisp-17.6 {TkTextScanCmd procedure} {textfonts} {
.t yview 1.0
.t xview moveto 0
+ updateText
.t scan mark 40 60
.t scan dragto 35 55
+ updateText
.t index @0,0
} {4.7}
test textDisp-17.7 {TkTextScanCmd procedure} {textfonts} {
.t yview 10.0
.t xview moveto 0
+ updateText
.t xview scroll 20 units
+ updateText
.t scan mark -10 60
.t scan dragto -5 65
+ updateText
.t index @0,0
set x [.t index @0,0]
.t scan dragto 0 [expr {70 + $fixedDiff}]
+ updateText
list $x [.t index @0,0]
} {6.12 2.5}
test textDisp-17.8 {TkTextScanCmd procedure} {textfonts} {
.t yview 1.0
.t xview moveto 0
+ updateText
.t scan mark 0 60
.t scan dragto 30 100
+ updateText
.t scan dragto 25 95
+ updateText
.t index @0,0
} {4.7}
test textDisp-17.9 {TkTextScanCmd procedure} {textfonts} {
.t yview end
.t xview moveto 0
+ updateText
.t xview scroll 100 units
+ updateText
.t scan mark 90 60
.t scan dragto 10 0
+ updateText
.t scan dragto 14 5
+ updateText
.t index @0,0
-} {18.44}
+} {14.44}
.t configure -wrap word
test textDisp-17.10 {TkTextScanCmd procedure, word wrapping} {textfonts} {
.t yview 10.0
+ updateText
.t scan mark -10 60
.t scan dragto -5 65
+ updateText
set x [.t index @0,0]
.t scan dragto 0 [expr {70 + $fixedDiff}]
+ updateText
list $x [.t index @0,0]
} {9.0 8.0}
.t configure -xscrollcommand scroll -yscrollcommand {}
@@ -3318,7 +3349,7 @@ test textDisp-24.15 {TkTextCharLayoutProc, -wrap none} {textfonts} {
list [.t bbox 1.19] [.t bbox 1.20]
} [list [list 136 3 7 $fixedHeight] [list 143 3 3 $fixedHeight]]
test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {textfonts} {
- if {$tcl_platform(platform) == "windows"} {
+ if {[tk windowingsystem] == "win32"} {
wm overrideredirect . 1
}
.t configure -wrap char
@@ -3328,7 +3359,7 @@ test textDisp-24.16 {TkTextCharLayoutProc, no chars fit} {textfonts} {
updateText
list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2]
} [list [list 3 3 1 $fixedHeight] [list 3 [expr {$fixedDiff + 16}] 1 $fixedHeight] [list 3 [expr {2*$fixedDiff + 29}] 1 $fixedHeight]]
-if {$tcl_platform(platform) == "windows"} {
+if {[tk windowingsystem] == "win32"} {
wm overrideredirect . 0
}
test textDisp-24.17 {TkTextCharLayoutProc, -wrap word} {textfonts} {
@@ -3654,7 +3685,7 @@ test textDisp-27.6 {SizeOfTab procedure, center alignment} {textfonts} {
.t tag add x 1.0 end
list [.t bbox 1.6] [.t bbox 1.7]
} [list [list 32 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 39 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential numerical problems)} {textfonts} {
+test textDisp-27.7 {SizeOfTab procedure, center alignment, wrap -none (potential numerical problems)} {textfonts failsOnXQuarz} {
.t delete 1.0 end
set cm [winfo fpixels .t 1c]
.t configure -tabs {1c 2c center 3c 4c 5c 6c 7c 8c} -wrap none -width 40