Tk Source Code

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

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

Overview
Comment:-selectforeground tag configuration option: tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-443
Files: files | file ages | folders
SHA1: b922e00e3ab051c0cbd33c1f62e1a401ee94d245
User & Date: fvogel 2016-02-09 21:30:11
Context
2016-02-09
21:32
-selectbgstipple tag configuration option: implementation check-in: 8c17f1a7 user: fvogel tags: tip-443
21:30
-selectforeground tag configuration option: tests check-in: b922e00e user: fvogel tags: tip-443
21:29
-selectforeground tag configuration option: documentation check-in: 0aa97efd user: fvogel tags: tip-443
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/textTag.test.

235
236
237
238
239
240
241











242
243
244
245
246
247
248
...
742
743
744
745
746
747
748























749
750
751
752
753
754
755
    .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.26 {tag configuration options} -constraints {
    haveCourier12
} -body {
    .t tag configure x -spacing1 10
    .t tag cget x -spacing1
} -cleanup {
    .t tag configure x -spacing1 [lindex [.t tag configure x -spacing1] 3]
................................................................................
    .t tag configure sel -selectbackground green
    .t configure -selectbackground red
    lappend x [.t tag cget sel -selectbackground]
    .t configure -selectbackground black
    .t tag configure sel -selectbackground white
    lappend x [.t cget -selectbackground]
    return $x























} -result {yellow blue red white}

test textTag-6.1 {TkTextTagCmd - "delete" option} -constraints {
    haveCourier12 
} -body {
    .t tag delete
} -returnCodes error -result {wrong # args: should be ".t tag delete tagName ?tagName ...?"}






>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
...
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
    .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 -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.25d {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 -spacing1 10
    .t tag cget x -spacing1
} -cleanup {
    .t tag configure x -spacing1 [lindex [.t tag configure x -spacing1] 3]
................................................................................
    .t tag configure sel -selectbackground green
    .t configure -selectbackground red
    lappend x [.t tag cget sel -selectbackground]
    .t configure -selectbackground black
    .t tag configure sel -selectbackground white
    lappend x [.t cget -selectbackground]
    return $x
} -result {yellow blue red white}
test textTag-5.24 {TkTextTagCmd - "configure" option} -body {
    set x {}
    # when [.t tag cget sel -selectforeground] == "", mirroring happens between
    #     the text widget option -selectforeground
    # and the tag         option -foreground
    .t tag configure sel -selectforeground {}
    .t configure -selectforeground black
    .t tag configure sel -foreground yellow
    lappend x [.t cget -selectforeground]
    .t tag configure sel -foreground orange
    .t configure -selectforeground blue
    lappend x [.t tag cget sel -foreground]
    # when [.t tag cget sel -selectforeground] != "", mirroring happens between
    #     the text widget option -selectforeground
    # and the tag         option -selectforeground
    .t tag configure sel -selectforeground green
    .t configure -selectforeground red
    lappend x [.t tag cget sel -selectforeground]
    .t configure -selectforeground black
    .t tag configure sel -selectforeground white
    lappend x [.t cget -selectforeground]
    return $x
} -result {yellow blue red white}

test textTag-6.1 {TkTextTagCmd - "delete" option} -constraints {
    haveCourier12 
} -body {
    .t tag delete
} -returnCodes error -result {wrong # args: should be ".t tag delete tagName ?tagName ...?"}