Re: Flicker when scrolling

From: Dmitry Karasik <dmitry_at_karasik.eu.org>
Date: 06 Aug 2004 12:11:24 +0200
To: prima_at_prima.eu.org

        Hi Teo!

On 06 Aug 04 at 07:08, "Teo" (Teo SANKARO) wrote:

 Teo> I am designing a custom widget, and it flickers when I scroll.
 Teo> Prima::Edit and Prima::PodView don't do this, so I know it's me and
 Teo> not the toolkit.

If you scroll not the whole but part of the widget, would all widget
flicker anyway? If so, it seems that you call scroll() in such a fashion
so the invalidated area covers all widget. Passing right parameters can
be tricky, so when I'm stuck with the correctness of what is invalidated
and what is repainted, I paint the rectangles what I'm about to scroll/
invalidate/repaint with sleep(2), for example:

   $self->rect_focus( @my_scroll_area); sleep(2); $self-> rect_focus(@my_scroll_area);
   $self-> scroll(@my_scroll_area);

and also inside on_paint before the actual painting.

   my @c = $canvas->clipRect;
   rect_focus(@c), sleep, rect_focus

It usually pays off for on_paint to be smart enough to redraw only the
invalidated area, as repored by ::clipRect, but scroll() does only
invalidates parts that are uncovered by the moved bits. In this flickering
case I'd recommend using its
parameters 'clipRect' and/or 'confineRect' ( see Prima::Widget/scroll docs)

-- 
Sincerely,
	Dmitry
--- www.karasik.eu.org ---
Received on Fri 06 Aug 2004 - 12:11:31 CEST

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:05 CET