• 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
change NSView background color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

change NSView background color


  • Subject: change NSView background color
  • From: "Ahmet Taha Sakar" <email@hidden>
  • Date: Sat, 14 Apr 2007 19:17:02 -0700

Hello,
I have the following code:
- (void)drawRect:(NSRect)rect
{
   rect = [self bounds];
   [NSColor blueColor] set];
   [NSBezierPath fillRect: rect];
}

- (void) changeColor: (NSColor *)c
{
   [[NSColor blackColor] set];
   [NSBezierPath fillRect: [self bounds]];
}

with the drawRect method,  I get to have the NSView in blue color.
However,  I would like to change the color with an action so I created
changeColor method.  But I cant get it to change the color.  What am I
missing?  thnaks
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: change NSView background color
      • From: Scott Stevenson <email@hidden>
  • Prev by Date: Re: NSDocumentController recentDocumentURLs hiding non-file based URLs
  • Next by Date: Re: change NSView background color
  • Previous by thread: Re: NSString and NSMutableString
  • Next by thread: Re: change NSView background color
  • Index(es):
    • Date
    • Thread