Tk Source Code

Check-in [23815eb1]
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:Update to implement TIP518 event name change
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip518-event-last-child-unmanaged
Files: files | file ages | folders
SHA3-256: 23815eb10d63d8ae9cdced4b46173c0a76e0584e1c1f891e1ab6470fcc686ae5
User & Date: oehhar 2018-09-22 19:10:12
Context
2018-09-22
20:31
Use the event name of the TIP: NoManagedChild check-in: ae8359e4 user: oehhar tags: tip518-event-last-child-unmanaged
19:10
Update to implement TIP518 event name change check-in: 23815eb1 user: oehhar tags: tip518-event-last-child-unmanaged
2016-09-21
06:32
(Modernized) patch from egavilan to fix [2863003fff] and [d6b95ce492] - tk frame does not shrink to 0 height if last children unpacked. A virtual event is sent when the pack or grid geometry manager leaves a parent without any slaves Leaf check-in: 60230550 user: fvogel tags: bug-d6b95ce492, rfe-2863003fff
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkGrid.c.

1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739


1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
    int width, height;		/* Requested size of layout, in pixels. */
    int realWidth, realHeight;	/* Actual size layout should take-up. */
    int usedX, usedY;

    masterPtr->flags &= ~REQUESTED_RELAYOUT;

    /*
     * If the master has no slaves anymore, then don't do anything at all:
     * just leave the master's size as-is, but signal the master with the
     * <<GeometryManager>> virtual event.
     * Otherwise there is no way to "relinquish" control over the master
     * so another geometry manager can take over.


     */

    if (masterPtr->slavePtr == NULL) {
        TkSendVirtualEvent(masterPtr->tkwin, "GeometryManager", NULL);
	return;
    }

    if (masterPtr->masterDataPtr == NULL) {
	return;
    }







|
<
<


>
>



|







1728
1729
1730
1731
1732
1733
1734
1735


1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
    int width, height;		/* Requested size of layout, in pixels. */
    int realWidth, realHeight;	/* Actual size layout should take-up. */
    int usedX, usedY;

    masterPtr->flags &= ~REQUESTED_RELAYOUT;

    /*
     * If the master has no slaves anymore, then don't change the master size.


     * Otherwise there is no way to "relinquish" control over the master
     * so another geometry manager can take over.
     * Send event to "NoManagedChilds" to inform about no managed grid but
     * not resized.
     */

    if (masterPtr->slavePtr == NULL) {
        TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChilds", NULL);
	return;
    }

    if (masterPtr->masterDataPtr == NULL) {
	return;
    }

Changes to generic/tkPack.c.

595
596
597
598
599
600
601
602
603
604
605
606


607
608
609
610
611
612
613
614
615
616
617
    int borderTop, borderBtm;
    int borderLeft, borderRight;
    int maxWidth, maxHeight, tmp;

    masterPtr->flags &= ~REQUESTED_REPACK;

    /*
     * If the master has no slaves anymore, then don't do anything at all:
     * just leave the master's size as-is, but signal the master with the
     * <<GeometryManager>> virtual event.
     * Otherwise there is no way to "relinquish" control over the master
     * so another geometry manager can take over.


     */

    if (masterPtr->slavePtr == NULL) {
        TkSendVirtualEvent(masterPtr->tkwin, "GeometryManager", NULL);
	return;
    }

    /*
     * Abort any nested call to ArrangePacking for this window, since we'll do
     * everything necessary here, and set up so this call can be aborted if
     * necessary.






|
<
<


>
>



|







595
596
597
598
599
600
601
602


603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
    int borderTop, borderBtm;
    int borderLeft, borderRight;
    int maxWidth, maxHeight, tmp;

    masterPtr->flags &= ~REQUESTED_REPACK;

    /*
     * If the master has no slaves anymore, then leave the master's size as-is.


     * Otherwise there is no way to "relinquish" control over the master
     * so another geometry manager can take over.
     * Send event to "NoManagedChilds" to inform about no managed grid but
     * not resized.
     */

    if (masterPtr->slavePtr == NULL) {
        TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChilds", NULL);
	return;
    }

    /*
     * Abort any nested call to ArrangePacking for this window, since we'll do
     * everything necessary here, and set up so this call can be aborted if
     * necessary.