FROM : Matt Neuburg
DATE : Mon Jun 26 19:41:12 2006
On Sat, 24 Jun 2006 04:25:23 -0700 (PDT), Angelo Chen <<email_removed>>
said:
>Hi,
>
>I use IB to create a NSMatrix containing of
>NSImageCell, at runtime I use NSImageCell's setImage
>to set the pictures, everything works. Now I like to
>attach a subclass of NSImageCell to the NSMatrix, as a
>testing I made following changes to the program:
>
>// ClipImage.h
>@interface ClipImage : NSImageCell {
>}
>
>// ClipImage.m
>- (void)setImage:(NSImage *)image
>{
>}
>
>and in my Controller class I had:
>
>- (void) awakeFromNib
>{
> [myMatrix setCellClass: [ClipImage class]];
>}
>
>with the above changes I was expecting no image to be
>displayed in the NSMatrix, but it still displays, why?
>am I attaching the subClass wrongly?
I find that it is necessary, in awakeFromNib, to remove all the existing
cells (rows and columns) and recreate them from scratch, in order to get the
app to accept what you say in code rather than what's set up in IB. m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
DATE : Mon Jun 26 19:41:12 2006
On Sat, 24 Jun 2006 04:25:23 -0700 (PDT), Angelo Chen <<email_removed>>
said:
>Hi,
>
>I use IB to create a NSMatrix containing of
>NSImageCell, at runtime I use NSImageCell's setImage
>to set the pictures, everything works. Now I like to
>attach a subclass of NSImageCell to the NSMatrix, as a
>testing I made following changes to the program:
>
>// ClipImage.h
>@interface ClipImage : NSImageCell {
>}
>
>// ClipImage.m
>- (void)setImage:(NSImage *)image
>{
>}
>
>and in my Controller class I had:
>
>- (void) awakeFromNib
>{
> [myMatrix setCellClass: [ClipImage class]];
>}
>
>with the above changes I was expecting no image to be
>displayed in the NSMatrix, but it still displays, why?
>am I attaching the subClass wrongly?
I find that it is necessary, in awakeFromNib, to remove all the existing
cells (rows and columns) and recreate them from scratch, in order to get the
app to accept what you say in code rather than what's set up in IB. m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
| Related mails | Author | Date |
|---|---|---|
| Angelo Chen | Jun 24, 13:25 | |
| Matt Neuburg | Jun 26, 19:41 |






Cocoa mail archive

