• 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: James DiPalma <email@hidden>
  • Date: Fri, 18 Jun 2004 03:37:28 -0700

It is quite easy to add the needed functionality (support for
target/action) to a subclass of NSImageCell.

I copied your code into a sample application, added a two-cell matrix of NSImageCells, set their subclass to ActionImageCell and set this matrix's mode to highlight.

It did not send actions.

I set up an array of NSButtonCells in highlight mode and a break point:

#0 -[Controller action:] ()
#2 0x92f64dc4 in -[NSMatrix sendAction:to:] ()
#3 0x92eb8abc in -[NSCell _sendActionFrom:] ()
#4 0x92e58500 in -[NSCell trackMouse:inRect:ofView:untilMouseUp:] ()
#5 0x92ec96cc in -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] ()
#6 0x92f07d0c in -[NSMatrix _mouseDownNonListmode:] ()
#7 0x92f63bf4 in -[NSMatrix mouseDown:] ()

There is something happening in NSCell's trackMouse:... that is sending its matrix's action to its matrix's target. It doesn't seem to be affected by implementing target/action and tag. I haven't played with cell mouse tracking enough to figure it out and can't find documentation that explains why NSCell will sometimes send an action and sometimes not.



-jim


On Jun 17, 2004, at 12:00 PM, John Pannell wrote:

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
_______________________________________________
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>)
 >Re: Scrolling List of Thumbnails? (From: John Pannell <email@hidden>)

  • Prev by Date: NSWindow without background color
  • Next by Date: internet connect problems
  • Previous by thread: Re: Scrolling List of Thumbnails?
  • Next by thread: Re: Scrolling List of Thumbnails?
  • Index(es):
    • Date
    • Thread