• 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
Removing Shadow from NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Removing Shadow from NSView


  • Subject: Removing Shadow from NSView
  • From: Jeremy Sacket <email@hidden>
  • Date: Fri, 22 Jul 2005 14:50:17 -0500

I have a class ShadowView that subclasses NSView. I have -(void) drawDropShadowForObject:(id)object and pass in the control (object) I want the shadow to be behind. It works perfect. However, I can not seem to remove the shadow unless I resize the window.

Here is what I have tried.
1. Call [[self superview] display]
2. Move the ShadowView off of the window
3. Set the shadowView to hide.

My question is were does the actual shadow reside? It seems to me that the shadow is not attached to the NSView the calls the [NSShadow set].
Any ideas or suggestions?


Here is my method to draw the shadow:
-(void)drawDropShadowForObject:(id)object
{
NSPoint p = [self convertPoint:[object bounds].origin fromView:object];
NSRect rect = NSMakeRect(p.x,p.y-[object bounds].size.height, [object bounds].size.width,[object bounds].size.height);
NSBezierPath *myPath = [NSBezierPath bezierPathWithRect:rect];
[self allocateGState];
NSShadow *shadow = [[NSShadow alloc] init];
[shadow setShadowBlurRadius: 10];
[shadow setShadowOffset: NSMakeSize (0, -5)];
[shadow setShadowColor:[NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:.5]];
[shadow set];



[[NSColor blackColor] set]; [myPath stroke]; [[NSColor whiteColor] set]; [myPath fill]; [self releaseGState];

}

Thanks,
Jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: [ANN] The Blue Technologies Group... (sorry, mea culpa, sorry) n/t
  • Next by Date: CoreData - isDeleted behavior question
  • Previous by thread: Re: NSPopUpButton refresh menu (bindings)
  • Next by thread: CoreData - isDeleted behavior question
  • Index(es):
    • Date
    • Thread