Finder Eject Button in OutlineView
Finder Eject Button in OutlineView
- Subject: Finder Eject Button in OutlineView
- From: kiran Sanka <email@hidden>
- Date: Mon, 1 Sep 2008 16:25:30 -0700
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.
kiran Sanka
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden