Tk Source Code

Check-in [ae788ecf]
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:Addressed question 4 (see artifact [9d48a9c212] of ticket [3f456a5bb9]).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-441
Files: files | file ages | folders
SHA1: ae788ecf965e471ad0d65a4b16f600b231e57e73
User & Date: fvogel 2016-01-17 21:09:52
Context
2016-01-18
09:47
Fixed bug with the listbox justify patch: with large borders, when moving the horizontal scrollbar fully to the right the edge of the border could not be seen, one needed to push once on the right arrow of the scrollbar to see it. Test case:
package require Tk destroy .top toplevel .top listbox .top.l -justify right -borderwidth 17 -highlightthickness 19 -selectborderwidth 22 scrollbar .top.hs -command ".top.l xview" -orient horizontal .top.l configure -xscrollcommand ".top.hs set" set huge [concat "START -" [string repeat "Huge Item... " 20] "- END"] .top.l insert end $huge pack .top.l -expand 1 -fill both pack .top.hs -expand 1 -fill x
check-in: 5f396dac user: fvogel tags: tip-441
2016-01-17
21:09
Addressed question 4 (see artifact [9d48a9c212] of ticket [3f456a5bb9]). check-in: ae788ecf user: fvogel tags: tip-441
20:40
Addressed questions 3 and 5 (see artifact [9d48a9c212] of ticket [3f456a5bb9]). It is not desirable to make the listbox xview jump on resizing. check-in: 33195408 user: fvogel tags: tip-441
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkListbox.c.

3626
3627
3628
3629
3630
3631
3632
3633

3634
3635
3636
3637
3638
3639
3640
....
3645
3646
3647
3648
3649
3650
3651





3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
}
 
/*
 *----------------------------------------------------------------------
 *
 * GetMaxOffset --
 *
 *	Passing in a listbox pointer, returns the maximum offset for the box.

 *
 * Results:
 *	Listbox's maxOffset.
 *
 * Side effects:
 *	None.
 *
................................................................................
{
    int maxOffset;

    maxOffset = listPtr->maxWidth -
            (Tk_Width(listPtr->tkwin) - 2*listPtr->inset -
            2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1;
    if (maxOffset < 0) {





        maxOffset = 0;
    }
    maxOffset -= maxOffset % listPtr->xScrollUnit;

    return maxOffset;
}
/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */






|
>







 







>
>
>
>
>













3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
....
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
}
 
/*
 *----------------------------------------------------------------------
 *
 * GetMaxOffset --
 *
 *	Passing in a listbox pointer, returns the maximum offset for the box,
 *	i.e. the maximum possible horizontal scrolling value (in pixels).
 *
 * Results:
 *	Listbox's maxOffset.
 *
 * Side effects:
 *	None.
 *
................................................................................
{
    int maxOffset;

    maxOffset = listPtr->maxWidth -
            (Tk_Width(listPtr->tkwin) - 2*listPtr->inset -
            2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1;
    if (maxOffset < 0) {

        /*
         * Listbox is larger in width than its largest width item.
         */

        maxOffset = 0;
    }
    maxOffset -= maxOffset % listPtr->xScrollUnit;

    return maxOffset;
}
/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */