• 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
Re: NSView and backgrounds, selectable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >NSView and backgrounds, selectable (From: "Matthew Jaffa" <email@hidden>)
 >Re: NSView and backgrounds, selectable (From: Yann Bizeul <email@hidden>)
 >Re: NSView and backgrounds, selectable (From: Matt Jaffa <email@hidden>)

  • Prev by Date: Re: setAccessoryView
  • Next by Date: Re: Best Cross-Platform Solution
  • Previous by thread: Re: NSView and backgrounds, selectable
  • Next by thread: Word Count Problem
  • Index(es):
    • Date
    • Thread