Tk Source Code

Check-in [949cce2a]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:-rmargincolor tag configuration option: tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-443
Files: files | file ages | folders
SHA1:949cce2a2ab5db10dcc57af9c0e312325a98dee8
User & Date: fvogel 2016-02-10 22:54:09
Context
2016-02-11
10:41
Fixed typo in comment (introduced by error in [6a21622c7e]) check-in: 623c5d28 user: fvogel tags: tip-443
2016-02-10
22:54
-rmargincolor tag configuration option: tests check-in: 949cce2a user: fvogel tags: tip-443
22:53
-rmargincolor tag configuration option: documentation check-in: e60ec9fe user: fvogel tags: tip-443
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/textTag.test.

247
248
249
250
251
252
253











254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
...
715
716
717
718
719
720
721
722
723
724

725
726
727



728
729
730
731
732
733
734
...
751
752
753
754
755
756
757






758
759
760
761
762
763
764
    haveCourier12
} -body {
    .t tag configure x -rmargin bad
} -cleanup {
    .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3]
} -returnCodes error -result {bad screen distance "bad"}
test textTag-1.25a {tag configuration options} -body {











    .t tag configure x -selectbackground #012345
    .t tag cget x -selectbackground
} -cleanup {
    .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3]
} -result {#012345}
test textTag-1.25b {configuration options} -body {
    .t tag configure x -selectbackground non-existent
} -cleanup {
    .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3]
} -returnCodes error -result {unknown color name "non-existent"}
test textTag-1.25c {tag configuration options} -body {
    .t tag configure x -selectbgstipple gray50
    .t tag cget x -selectbgstipple
} -cleanup {
    .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3]
} -result {gray50}
test textTag-1.25d {configuration options} -body {
    .t tag configure x -selectbgstipple badStipple
} -cleanup {
    .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3]
} -returnCodes error -result {bitmap "badStipple" not defined}
test textTag-1.25e {tag configuration options} -body {
    .t tag configure x -selectfgstipple gray50
    .t tag cget x -selectfgstipple
} -cleanup {
    .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3]
} -result {gray50}
test textTag-1.25f {configuration options} -body {
    .t tag configure x -selectfgstipple badStipple
} -cleanup {
    .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3]
} -returnCodes error -result {bitmap "badStipple" not defined}
test textTag-1.25g {tag configuration options} -body {
    .t tag configure x -selectforeground #012345
    .t tag cget x -selectforeground
} -cleanup {
    .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3]
} -result {#012345}
test textTag-1.25h {configuration options} -body {
    .t tag configure x -selectforeground non-existent
} -cleanup {
    .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3]
} -returnCodes error -result {unknown color name "non-existent"}
test textTag-1.26 {tag configuration options} -constraints {
    haveCourier12
} -body {
................................................................................
    .t tag configure x -offset 1.0q
} -cleanup {
    .t tag delete x
} -returnCodes error -result {bad screen distance "1.0q"}
test textTag-5.13 {TkTextTagCmd - "configure" option} -body {
    .t tag delete x
    .t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5 \
        -lmargincolor darkblue
    list [.t tag configure x -lmargin1] [.t tag configure x -lmargin2] \
        [.t tag configure x -rmargin] [.t tag configure x -lmargincolor]

} -cleanup {
    .t tag delete x
} -result {{-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} {-rmargin {} {} {} 5} {-lmargincolor {} {} {} darkblue}}



test textTag-5.14 {TkTextTagCmd - "configure" option} -constraints {
    haveCourier12 
} -body {
    .t tag delete x
    .t tag configure x -lmargin1 2.0x
} -cleanup {
    .t tag delete x
................................................................................
    haveCourier12 
} -body {
    .t tag delete x
    .t tag configure x -rmargin 140.1.1
} -cleanup {
    .t tag delete x
} -returnCodes error -result {bad screen distance "140.1.1"}






.t tag delete x
test textTag-5.17 {TkTextTagCmd - "configure" option} -constraints {
    haveCourier12 
} -body {
    .t tag delete x
    .t tag configure x -spacing1 2 -spacing2 4 -spacing3 6
    list [.t tag configure x -spacing1] [.t tag configure x -spacing2] \







>
>
>
>
>
>
>
>
>
>
>





|




|





|




|





|




|





|







 







|

|
>


|
>
>
>







 







>
>
>
>
>
>







247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
...
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
...
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
    haveCourier12
} -body {
    .t tag configure x -rmargin bad
} -cleanup {
    .t tag configure x -rmargin [lindex [.t tag configure x -rmargin] 3]
} -returnCodes error -result {bad screen distance "bad"}
test textTag-1.25a {tag configuration options} -body {
    .t tag configure x -rmargincolor darkblue
    .t tag cget x -rmargincolor
} -cleanup {
    .t tag configure x -rmargincolor [lindex [.t tag configure x -rmargincolor] 3]
} -result {darkblue}
test textTag-1.25b {configuration options} -body {
    .t tag configure x -rmargincolor non-existent
} -cleanup {
    .t tag configure x -rmargincolor [lindex [.t tag configure x -rmargincolor] 3]
} -returnCodes error -result {unknown color name "non-existent"}
test textTag-1.25c {tag configuration options} -body {
    .t tag configure x -selectbackground #012345
    .t tag cget x -selectbackground
} -cleanup {
    .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3]
} -result {#012345}
test textTag-1.25d {configuration options} -body {
    .t tag configure x -selectbackground non-existent
} -cleanup {
    .t tag configure x -selectbackground [lindex [.t tag configure x -selectbackground] 3]
} -returnCodes error -result {unknown color name "non-existent"}
test textTag-1.25e {tag configuration options} -body {
    .t tag configure x -selectbgstipple gray50
    .t tag cget x -selectbgstipple
} -cleanup {
    .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3]
} -result {gray50}
test textTag-1.25f {configuration options} -body {
    .t tag configure x -selectbgstipple badStipple
} -cleanup {
    .t tag configure x -selectbgstipple [lindex [.t tag configure x -selectbgstipple] 3]
} -returnCodes error -result {bitmap "badStipple" not defined}
test textTag-1.25g {tag configuration options} -body {
    .t tag configure x -selectfgstipple gray50
    .t tag cget x -selectfgstipple
} -cleanup {
    .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3]
} -result {gray50}
test textTag-1.25h {configuration options} -body {
    .t tag configure x -selectfgstipple badStipple
} -cleanup {
    .t tag configure x -selectfgstipple [lindex [.t tag configure x -selectfgstipple] 3]
} -returnCodes error -result {bitmap "badStipple" not defined}
test textTag-1.25i {tag configuration options} -body {
    .t tag configure x -selectforeground #012345
    .t tag cget x -selectforeground
} -cleanup {
    .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3]
} -result {#012345}
test textTag-1.25j {configuration options} -body {
    .t tag configure x -selectforeground non-existent
} -cleanup {
    .t tag configure x -selectforeground [lindex [.t tag configure x -selectforeground] 3]
} -returnCodes error -result {unknown color name "non-existent"}
test textTag-1.26 {tag configuration options} -constraints {
    haveCourier12
} -body {
................................................................................
    .t tag configure x -offset 1.0q
} -cleanup {
    .t tag delete x
} -returnCodes error -result {bad screen distance "1.0q"}
test textTag-5.13 {TkTextTagCmd - "configure" option} -body {
    .t tag delete x
    .t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5 \
        -lmargincolor darkblue -rmargincolor lightgreen
    list [.t tag configure x -lmargin1] [.t tag configure x -lmargin2] \
        [.t tag configure x -rmargin] [.t tag configure x -lmargincolor] \
        [.t tag configure x -rmargincolor]
} -cleanup {
    .t tag delete x
} -result [list {-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} \
                {-rmargin {} {} {} 5} \
                {-lmargincolor {} {} {} darkblue} {-rmargincolor {} {} {} lightgreen} \
          ]
test textTag-5.14 {TkTextTagCmd - "configure" option} -constraints {
    haveCourier12 
} -body {
    .t tag delete x
    .t tag configure x -lmargin1 2.0x
} -cleanup {
    .t tag delete x
................................................................................
    haveCourier12 
} -body {
    .t tag delete x
    .t tag configure x -rmargin 140.1.1
} -cleanup {
    .t tag delete x
} -returnCodes error -result {bad screen distance "140.1.1"}
test textTag-5.16a {TkTextTagCmd - "configure" option} -body {
    .t tag delete x
    .t tag configure x -rmargincolor rainbow
} -cleanup {
    .t tag delete x
} -returnCodes error -result {unknown color name "rainbow"}
.t tag delete x
test textTag-5.17 {TkTextTagCmd - "configure" option} -constraints {
    haveCourier12 
} -body {
    .t tag delete x
    .t tag configure x -spacing1 2 -spacing2 4 -spacing3 6
    list [.t tag configure x -spacing1] [.t tag configure x -spacing2] \