Re: NSView and backgrounds, selectable
Re: NSView and backgrounds, selectable
- Subject: Re: NSView and backgrounds, selectable
- From: Shawn Erickson <email@hidden>
- Date: Tue, 11 May 2004 15:06:52 -0700
On May 4, 2004, at 4:09 PM, Matt Jaffa wrote:
Hey,
yeah you have the gist of what I am trying to do.
The color is properly being made in the views,
but after it has been select how then do I change the color and have
it draw it again,
but it is not working the way I did it, I made a method
setBackGroundColor:(NSColor*)theColor
{
NSBezierPath *surface = [ NSBezierPath bezierPathWithRect: [ self
bounds ]];
[[ NSColor redColor ] set ];
[ surface fill ];
[ super drawRect: [self visibleRect] ];
}
Things don't work this way... use setNeedsDisplay:YES on the view in
question instead and do your custom drawing while in a call to drawRect
(you need to subclass NSView likely).
Review NSViews documentation and the links from that doc...
<
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSView.html#//apple_ref/occ/cl/
NSView>
-Shawn
_______________________________________________
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.