On Friday, March 29, 2019 at 6:41:21 AM UTC-7, Nicolas wrote:
> Le vendredi 29 mars 2019 13:48:49 UTC+1, nemethi a écrit :
> > Am 29.03.19 um 05:04 schrieb Nicolas:
> > > Le jeudi 28 mars 2019 17:36:08 UTC+1, Nicolas a écrit :
> > > [...]
> > > changing updateColors to updateColorsWhenIdle improve the scroll (being more smooth)
> > > I still have lag because of redisplayVisibleItems...
> > > if I remove this call, my tablelist is perfectly smooth when scrolling :)
> > >
> > > in case on <Button-4>, <Button-5> or <MouseWheel> binding over the body of the tablelist, does all following calls are necessary?
> > > adjustElidedText $win
> > > redisplayVisibleItems $win
> > > updateColors $win
> > > adjustSepsWhenIdle $win
> > >
> > > best regards,
> > > nicolas
> > >
> >
> > Those procedure invocations update the view and therefore they are
> > necessary.
> >
> > Replacing updateColors with updateColorsWhenIdle can have the negative
> > effect that the delay with which the color updates within the changed
> > view are performed leads to some optical artifacts, especially in the
> > presence of embedded images or windows.
> >
> > Removing the redisplayVisibleItems invocation is no good idea because
> > this procedure is responsible for updating the texts within the changed
> > view. However, you can improve the scrolling performance by setting the
> > -displayondemand option to false (please a look at the description of
> > this option in the reference manual).
> >
> > --
> > Csaba Nemethi
http://www.nemethi.de
>
> thank you for your answer,
> I've set -displayondemand 0 but I'm still facing huge lag, especially when the scrollbar is at the top or at the bottom.
>
> best regards,
> nicolas
I don't use tablelist, but I found that this sort of code
was necessary for 'moveto' (i.e. grab the scrollbar handle and move it)
to prevent lagging when updating the display while scrolling:
if { $cmd eq "moveto" } {
if { $sdvars(scroll.afterid) ne {} } {
after cancel $sdvars(scroll.afterid)
}
set sdvars(scroll.afterid) [after 1 [list [self] sd_scroll]]
}
# where sd_scroll is the actual display update procedure...
A slight delay to wait for another 'moveto' command and if one is received,
restart the after command. A delay of 1 is a bit small, I could raise
that to 5 probably.
The same sort of thing could be done for the other scroll operations
(in which case, I would use a delay of 1).
My application's display update is not as heavy as tablelist, so I can't
really run a meaningful test. The scrollwheel works fine with or without
the delay in my particular situation.