• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scrolling List of Thumbnails?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrolling List of Thumbnails?


  • Subject: Re: Scrolling List of Thumbnails?
  • From: John Pannell <email@hidden>
  • Date: Thu, 17 Jun 2004 13:00:45 -0600

Hi listers-

On Jun 17, 2004, at 12:03 PM, James DiPalma wrote:

> An NSmatrix in highlight mode or track mode should be sending mouse
> events to its cells, so you probably need some kind of NSActionCell
> subclass that displays images how you want them displayed. Embedding
> an NSImageCell into an NSActionCell subclass should be pretty easy
> (imageCell ivar used whenever needed), but you won't be able to get IB
> to create a matrix of NSCells, nor NSActionCells, so maybe an
> NSButtonCell subclass that embeds an NSImageCell.

It is quite easy to add the needed functionality (support for
target/action) to a subclass of NSImageCell. Here's a sample header
and implementation with the relevant additions...

Header...

#import <AppKit/AppKit.h>

@interface PSMActionImageCell : NSImageCell {
int tag;
id target;
SEL action;
BOOL enabled;
}

- (id)target;
- (void)setTarget:(id)anObject;
- (SEL)action;
- (void)setAction:(SEL)aSelector;
- (int)tag;
- (void)setTag:(int)value;

@end

Implementation...

@implementation PSMActionImageCell
- (id)target
{
return target;
}

- (void)setTarget:(id)anObject
{
[anObject retain];
[target release];
target = anObject;
}

- (SEL)action
{
return action;
}

- (void)setAction:(SEL)aSelector
{
action = aSelector;
}

- (int)tag
{
return tag;
}

- (void)setTag:(int)value
{
tag = value;
}

A matrix of these will be clickable and generate the proper messages
(as set by assigning the target of the matrix in IB).

Hope this helps!

John
_______________________________________________
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.


References: 
 >Scrolling List of Thumbnails? (From: Jerry LeVan <email@hidden>)
 >Re: Scrolling List of Thumbnails? (From: Jerry LeVan <email@hidden>)
 >Re: Scrolling List of Thumbnails? (From: James DiPalma <email@hidden>)

  • Prev by Date: Re: sin(4*pi^2*t) 0 >= t <= pi/3, can you read this ?
  • Next by Date: KVO how to determine observers
  • Previous by thread: Re: Scrolling List of Thumbnails?
  • Next by thread: Re: Scrolling List of Thumbnails?
  • Index(es):
    • Date
    • Thread