Tk Source Code

Check-in [9ac3dfe7]
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:Added tests checking that <<NoManagedChild>> fires on destruction of the last managed child
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip518-event-last-child-unmanaged
Files: files | file ages | folders
SHA3-256: 9ac3dfe74e292604acbd01d739d67bee8ca70aee3ffe7ce730a4ac537e7a1c40
User & Date: fvogel 2018-10-30 22:07:48
Context
2018-10-30
22:55
Add tests for the 'propagate off' case of pack and grid check-in: 2058b166 user: fvogel tags: tip518-event-last-child-unmanaged
22:07
Added tests checking that <<NoManagedChild>> fires on destruction of the last managed child check-in: 9ac3dfe7 user: fvogel tags: tip518-event-last-child-unmanaged
2018-10-29
23:01
Enhance the tests for <<NoManagedChild>>, and fix the implementation so that this event only fires when the last slave is forgotten/removed. check-in: 70839a22 user: fvogel tags: tip518-event-last-child-unmanaged
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/grid.test.

2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048













2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
    grid forget .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    grid_reset 24.1
} -result {1}

test grid-24.2 {<<NoManagedChild>> fires on last grid remove} -body {
    global A
    catch {unset A}
    grid [frame .1]
    update
    bind . <<NoManagedChild>> {set A 1}
    grid remove .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    grid_reset 24.2
} -result {1}














test grid-24.3 {<Configure> does not fire on last grid forget} -body {
    global A
    catch {unset A}
    grid [frame .1]
    update
    bind . <Configure> {set A 1}
    grid forget .1
    update
    info exists A
} -cleanup {
    bind . <Configure> {}
    grid_reset 24.3
} -result {0}

test grid-24.4 {<Configure> fires on forelast grid forget} -body {
    global A
    catch {unset A}
    grid [frame .1]
    grid [frame .2]
    update
    bind . <Configure> {set A 1}
    grid forget .1
    update
    info exists A
} -cleanup {
    bind . <Configure> {}
    grid_reset 24.4
} -result {1}

test grid-24.5 {<<NoManagedChild>> does not fire on forelast grid forget} -body {
    global A
    catch {unset A}
    grid [frame .1]
    grid [frame .2]
    update
    bind . <<NoManagedChild>> {set A 1}
    grid forget .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    grid_reset 24.5
} -result {0}

test grid-24.6 {<<NoManagedChild>> does not fire on grid anchor} -body {
    global A
    bind . <<NoManagedChild>> {set A 1}
    grid anchor . w
    update
    info exists A
} -cleanup {
    grid anchor . nw
    bind . <<NoManagedChild>> {}
    grid_reset 24.6
} -result {0}

 
# cleanup
cleanupTests
return

# Local Variables:
# mode: tcl
# End:






<













<
>
>
>
>
>
>
>
>
>
>
>
>
>
|










|

<
|











|

<
|











|

<
|








|










2027
2028
2029
2030
2031
2032
2033

2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046

2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072

2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086

2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100

2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
    grid forget .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    grid_reset 24.1
} -result {1}

test grid-24.2 {<<NoManagedChild>> fires on last grid remove} -body {
    global A
    catch {unset A}
    grid [frame .1]
    update
    bind . <<NoManagedChild>> {set A 1}
    grid remove .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    grid_reset 24.2
} -result {1}

test grid-24.3 {<<NoManagedChild>> fires on last gridded child destruction} -body {
    global A
    catch {unset A}
    grid [frame .1]
    update
    bind . <<NoManagedChild>> {incr A}
    destroy .1
    update
    set A
} -cleanup {
    bind . <<NoManagedChild>> {}
    grid_reset 24.3
} -result {1}
test grid-24.4 {<Configure> does not fire on last grid forget} -body {
    global A
    catch {unset A}
    grid [frame .1]
    update
    bind . <Configure> {set A 1}
    grid forget .1
    update
    info exists A
} -cleanup {
    bind . <Configure> {}
    grid_reset 24.4
} -result {0}

test grid-24.5 {<Configure> fires on forelast grid forget} -body {
    global A
    catch {unset A}
    grid [frame .1]
    grid [frame .2]
    update
    bind . <Configure> {set A 1}
    grid forget .1
    update
    info exists A
} -cleanup {
    bind . <Configure> {}
    grid_reset 24.5
} -result {1}

test grid-24.6 {<<NoManagedChild>> does not fire on forelast grid forget} -body {
    global A
    catch {unset A}
    grid [frame .1]
    grid [frame .2]
    update
    bind . <<NoManagedChild>> {set A 1}
    grid forget .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    grid_reset 24.6
} -result {0}

test grid-24.7 {<<NoManagedChild>> does not fire on grid anchor} -body {
    global A
    bind . <<NoManagedChild>> {set A 1}
    grid anchor . w
    update
    info exists A
} -cleanup {
    grid anchor . nw
    bind . <<NoManagedChild>> {}
    grid_reset 24.7
} -result {0}

 
# cleanup
cleanupTests
return

# Local Variables:
# mode: tcl
# End:

Changes to tests/pack.test.

1635
1636
1637
1638
1639
1640
1641
1642













1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
    pack forget .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    destroy .1
} -result {1}














test pack-20.2 {<Configure> does not fire on last pack forget} -body {
    global A
    catch {unset A}
    pack [frame .1]
    update
    bind . <Configure> {set A 1}
    pack forget .1
    update
    info exists A
} -cleanup {
    bind . <Configure> {}
    destroy .1
} -result {0}

test pack-20.3 {<<NoManagedChild>> does not fire on forelast pack forget} -body {
    global A
    catch {unset A}
    pack [frame .1]
    pack [frame .2]
    update
    bind . <<NoManagedChild>> {set A 1}
    pack forget .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    destroy .1 .2
} -result {0}

test pack-20.4 {<Configure> does not fire on last pack forget} -body {
    global A
    catch {unset A}
    pack [frame .1]
    pack [frame .2]
    update
    bind . <Configure> {set A 1}
    pack forget .1






<
>
>
>
>
>
>
>
>
>
>
>
>
>
|












<
|













<
|







1635
1636
1637
1638
1639
1640
1641

1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667

1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681

1682
1683
1684
1685
1686
1687
1688
1689
    pack forget .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    destroy .1
} -result {1}

test pack-20.2 {<<NoManagedChild>> fires on last packed child destruction} -body {
    global A
    catch {unset A}
    pack [frame .1]
    update
    bind . <<NoManagedChild>> {incr A}
    destroy .1
    update
    set A
} -cleanup {
    bind . <<NoManagedChild>> {}
    destroy .1
} -result {1}
test pack-20.3 {<Configure> does not fire on last pack forget} -body {
    global A
    catch {unset A}
    pack [frame .1]
    update
    bind . <Configure> {set A 1}
    pack forget .1
    update
    info exists A
} -cleanup {
    bind . <Configure> {}
    destroy .1
} -result {0}

test pack-20.4 {<<NoManagedChild>> does not fire on forelast pack forget} -body {
    global A
    catch {unset A}
    pack [frame .1]
    pack [frame .2]
    update
    bind . <<NoManagedChild>> {set A 1}
    pack forget .1
    update
    info exists A
} -cleanup {
    bind . <<NoManagedChild>> {}
    destroy .1 .2
} -result {0}

test pack-20.5 {<Configure> does not fire on last pack forget} -body {
    global A
    catch {unset A}
    pack [frame .1]
    pack [frame .2]
    update
    bind . <Configure> {set A 1}
    pack forget .1