Re: NSTableview background image for column?
Re: NSTableview background image for column?
- Subject: Re: NSTableview background image for column?
- From: Kyle Sluder <email@hidden>
- Date: Sun, 25 Apr 2010 10:23:48 -0700
On Apr 24, 2010, at 12:52 PM, Izak van Langevelde <email@hidden>
wrote:
The table shows a so-called 'exposure sheet' for an animation, where
each row corresponds to one frame, and the columns correspond to the
various foreground and background animation layers. There is one
column for audio, and for synchronization purposes it is nice to
show a wave form of the audio. However, the waveform is fixed, i.e.
not editable, so adding and deleting table rows only affects the
position fn table rows with respect to the audio: the audio is
background, both as audio and as picture. Columns are not sortable,
although it would be nice to be able to reorder them.
It sounds like you're going for something similar to what you'd see if
you looked at a reel of 8mm film.
Since at some point you have to generate the entire waveform as one
image, I'd probably use a custom NSCell subclass in the appropriate
column, and point it at the NSImage that contains your waveform. Then
when the tableview goes to draw that cell in a row (I believe the
delegate method informing you of this is called -
tableView:willDisplayCell: or something similar) I'd poke the cell to
tell it what offset into the image it should draw. The cell's drawing
method would then draw the subset of the waveform image.
This avoids the problem you describe of creating tons of image slices;
there's only one NSImage object but your cells are smart enough to
share it and only draw the relevant parts when asked.
HTH,
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden