Re: [Q] how to tell when drawing is done?
Re: [Q] how to tell when drawing is done?
- Subject: Re: [Q] how to tell when drawing is done?
- From: Steve Christensen <email@hidden>
- Date: Wed, 4 Feb 2004 11:58:06 -0800
On Feb 4, 2004, at 10:44 AM, mmalcolm crawford wrote:
On Feb 4, 2004, at 10:03 AM, Steve Christensen wrote:
Is there a way to tell when all subviews of a certain view have
completed drawing themselves?
I have a NSWindowController managing a window that contains a
NSTabView that contains NSTableViews as subviews. When I switch to a
new tab (usually the first time), it's possible that the data source
supplying the table could take a little while to get its data in
order. I'd like to display a spinning NSProgressIndicator while all
this is going on until the views finish drawing.
I have no problem starting up the indicator in the tab view's
tabView:willSelectTabViewItem: delegate method, but I don't know
where to stop it. Ideas?
How long does the drawing itself take to do? I'd guess less time than
retrieving the data? So you might want to stop when the data has been
fetched? What object does the fetching? It could send either a
message directly, or a notification...
Actually, grabbing the raw data is pretty speedy since it's entirely
available locally; the slow part is in preparing it for display. I have
a model object that actually manages the raw data, and the window
controller sits in-between the model and the view and acts, among other
things, as the table view's data source.
I'm working with a bunch of QuickTime movies, and I'm loading their
poster frames to use as thumbnails in the table (based on a file path
supplied by the model). My controller class keeps a cache of those
images that have already been created, but when the tab is first
selected, the cache is empty so it's taking awhile to get those images
loaded and cached. Once cached, the display is really speedy, only
taking a slight hit when a new row is first scrolled into view. I'm
trying to take a lazy load approach so it doesn't take forever to cache
-all- the images in the beginning if the user just happens to click on
that tab to see what's available. Right now it's taking around 5
seconds from the time I click on the tab until the display has finished
drawing.
Does this explanation make sense as a way to do this sort of thing? Or
is it better have the data source, in the background, start caching the
images and report to the table view what the current number of
processed images is, updating the count periodically, until they're all
cached?
Thanks,
steve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.