Re: Live scrolling
Re: Live scrolling
- Subject: Re: Live scrolling
- From: Guy English <email@hidden>
- Date: Tue, 16 Nov 2004 16:37:35 -0500
Hi,
Use a separate thread for loading the icons for the whole list.
When you open a directory send all the files to a worker thread, in
the worker thread pop a work order off the queue, load the icon, send
a notification back to the main thread that it's icon is ready, and
continue until there are no more work orders. Use a placeholder icon
for when you display a list element that doesn't have it's icon loaded
yet. Try caching the most popular icons too. It's a bit of work but
it'll keep your UI responsive. This method *does* have the
disadvantage that if you open a large directory then jump directly to
the end of the list it'll be a while before all the icons down there
get updated. I suppose you could send hints to the worker thread to
reprioritize it's work orders to iron that kind of thing out though.
Hope that helps,
Guy
On Tue, 16 Nov 2004 11:53:26 -0800, Eric Long <email@hidden> wrote:
> Hi,
>
> May application displays large lists of file system items, often thousands
> of items. The display is Finder-like, including the icons for items in the
> list. Since there may be a very large number of items, II don't want to
> cache the icons for all of these items. Instead, I obtain the icons for
> items as required in order to draw them.
>
> This works mostly very well, but not when the user is dragging the
> knob/thumb to live scroll the list. Scrolling is noticeably inhibited by
> the icon fetching. It appears that if I drag the knob a large distance
> (relatively speaking) the table view wants to obtain the icon for every item
> that would be displayed in the scroll distance, despite the fact that most
> would just be a blur going by.
>
> It seems to me that to speed things up I need to avoid the expensive hit of
> fetching the icons for items that are just zooming by, and fill them in when
> scrolling stops or slows down enough that there is no noticeable penalty.
>
> Has anyone set up a system like that? Any thoughts about achieving it? Any
> better ideas about speeding up live scrolling for this?
>
> Thanks in advance,
>
> Eric
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden