On Sep 1, 2008, at 4:25 PM, kiran Sanka wrote:

I am trying to figure out how I might be able to do something like Finder does displaying disc Eject Image(When disc inserted) indicator as part of an outline item.
I did by customizing NSTextField Cell as below

- (void) drawWithFrame:(NSRect)inRect inView:(NSView *)inView
{
        // First we split the cell in two
        NSRect textFrame, imageFrame;
NSDivideRect (inRect, &imageFrame, &textFrame, 3.0f + [urlIcon size].width, NSMaxXEdge);
        
        if([self icon] != nil)
        {
NSPoint imageLocation = NSMakePoint( NSMidX(imageFrame), NSMidY (imageFrame) );
                imageLocation.x -= [urlIcon size].width/2.0f;
                imageLocation.y -= [urlIcon size].height/2.0f;
                
                // Draw the Disc Eject image
                if ([[NSGraphicsContext currentContext] isDrawingToScreen])
                {
                        if ([[self stringValue] length]) {
                                [urlIcon drawAtPoint:imageLocation
fromRect:NSMakeRect( 0, 0, [urlIcon size].width, [urlIcon size].height )
                                                operation:NSCompositeSourceOver
                                                fraction:1.0f];
                        }
                }
                [super drawWithFrame:textFrame inView:inView];
        }       
        // Let our super do what it does best
        [super drawWithFrame:inRect inView:inView];
}
But when mouse roll over to discEjectImage i would like set another image like finder EjectImage.But i dont know how to work out with mouseEntered and mouseMove in a particular cell of an outlineView
I'd be grateful is someone could push me in the right direction.

Sure,

http://developer.apple.com/samplecode/PhotoSearch/index.html

-corbin
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to