Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageCell in a TableView?



On Fri, 25 Mar 2005 08:14:53 -0800, Jim Marschke <email@hidden> said:
>I'd like to have a cell in a tableview which displays a small graphic
>-- like a color swatch or a pict.
>
>I can add an NSImageCell to a column of my tableview, but just doing
>that causes my app to crash when I run it.
>
>Is this not possible?

No, it is not not possible. I mean, uh, yes, it is possible. I mean...
Anyhow, yes, you can do this and it's quite common - obviously, since that
is what the NSImageCell is for in Interface Builder (right below the
NSTableView). 

>If it is possible, how would I later get a reference to the ImageCell
>to set it's value?

I know how to do this only the Cocoa way. I don't mean you have to use
Objective-C (call method), though you might; I mean I don't know how to do
it by way of an ASKDataSource object. The Cocoa way, which can also be used
in ASK, is the old way: you allow the table view to ask your code the Two
Big Questions - how many rows are there in the table, and what's the value
at this row/column intersection? When it asks that second question, you tell
it the image you want displayed. m.

-- 
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.